← All articles

Blog · How it works

How LassoCut picks the right processing for each photo

A headshot, a pair of trainers, a dog in the grass and a logo are four very different jobs. LassoCut does not push all of them through the same recipe: it first looks at what is in the photo, then sends the photo down the path that suits that kind of subject. Here is what happens between the moment you send an image and the moment you get the cut-out back, in plain words, and what you can control.

1. First, LassoCut looks at what is in the photo

Before any background is removed, a classifier looks at the whole image and decides which kind of subject it shows. The categories are the ones the API documents: person, product, animal, car, transportation (motorbikes, bikes, boats, planes), graphic (logos, illustrations, badges) and other for anything that fits none of them, such as a plant or a landscape.

This step is quick, and it happens on a reduced copy of your photo, not on the full file. Its only job is to answer one question: “what am I looking at?” The answer decides what happens next, and it is reported back to you with the result.

2. Then it uses the path that suits that subject

Once the subject type is known, LassoCut picks the processing for it. Today, that works like this:

  • People get a second look. When the photo shows a person, LassoCut checks how much of the frame the face takes up. A headshot, where the face is large, goes to a model chosen for portraits. Other photos of people, full-body shots and groups included, stay with the model used for people in general. Both come back labelled person. More on this in portraits and hair.
  • Products, cars, graphics and other objects go to our general model, the one that did best on non-people subjects in our own side-by-side tests.
  • Large results get a high-resolution pass. When you ask for a big output, a high-resolution pass takes over so that fine edges hold up at that size. For animals, that pass uses a model chosen for fur. Headshots keep their own model at every size. Previews, which are small, use the faster models: a high-resolution pass would only cost time there, because a small image cannot show the extra edge detail. See HD cut-outs.

Whatever path a photo takes, the models only produce a mask: a map that says, pixel by pixel, how much of the subject is there. That mask is then resized to the output size you asked for and applied to the pixels of your own photo. The colours of your subject are your original colours; nothing is repainted.

3. The type parameter: let it guess, or tell it

In the API, the type field controls the first step. It accepts auto (the default), person, product, car, animal, graphic and transportation.

  • type=auto: the classifier decides, photo by photo. This is the right choice for a mixed folder.
  • A forced type, such as type=product: the classifier is skipped and the photo goes straight down that path. Use it when you already know what every photo is, for example a shop catalogue where every image is a product, or a school shoot where every image is a person. Forcing person still lets LassoCut tell a headshot from a full-body shot.

Forcing a type is also useful when the classifier gets one of your photos wrong: a mannequin read as a person, or a toy car read as a car when you want it treated as a product. A value that is not on the list is refused with the error invalid_type, and errors cost nothing.

Here is the documented curl call with the type forced to product:

curl --fail-with-body -H "X-Api-Key: $LASSOCUT_API_KEY" \
     -F "image_file=@photo.jpg" \
     -F "type=product" \
     -F "size=auto" \
     -o no-bg.png \
     https://api.lassocut.com/v1.0/removebg

The same choice exists outside the API: the command-line tool takes --type, and the n8n node lists the subject type among its options. The free try on the home page always uses auto.

4. What you get back: X-Type and friends

Every successful call returns the image, plus a few response headers that describe it. The one that matters here is X-Type: the subject type that was used, either detected (with auto) or the one you requested.

How detailed it is depends on type_level. At level 1, the default, X-Type is one of person, product, animal, car or other. Level 2 adds transportation and graphics. type_level=none leaves the header out. So a logo detected as a graphic comes back as X-Type: other, and as graphics with type_level=2.

The other headers are documented in the API reference: X-Width and X-Height for the size of the returned image, X-Credits-Charged, the bounding box of the subject in X-Foreground-Top, -Left, -Width and -Height, and your rate-limit window. If you use the n8n node, the same subject type shows up in the JSON as detected_type, next to credits_charged, width and height.

Why would you read X-Type? To sort results automatically, for one: send people to one folder and products to another. And to spot mistakes: if a catalogue run reports a person in the middle of products, that photo deserves a look, and perhaps a re-run with type=product.

The detected type also drives shadows. A drop shadow can be set globally or per subject type, for example shadow_type[product]=drop, and LassoCut applies the setting that matches the type it used for that photo.

5. Hair, glass and low contrast: what to expect

Hair and fur. The mask is not just on or off. Soft edges get partly transparent pixels, so hair blends onto a new background instead of ending in a hard outline. Headshots have their own model, and at large sizes animals go through the pass chosen for fur. Our honest limit: very fine hairs on very large files can look slightly softer than the rest of the photo.

Specks. After the mask is made, small isolated specks far from the subject are removed, so a stray patch of background does not survive or widen the subject's bounding box. Soft edges right next to the subject, like hair, are kept.

Glass and transparent objects. There is no special glass mode. The semitransparency parameter is accepted for compatibility with existing code, but it does not change the result today. Glass gets the same partly transparent mask as everything else, so test your own glassware on previews before a big run.

Low contrast. A subject that looks like its background is the hard case for any background remover: blond hair on a beige wall, a white product on a white table. Strands can be lost, or a bit of the wall kept. Run your ten hardest photos as free previews first.

6. When something goes wrong

  • No subject found. If the mask comes back almost empty, LassoCut returns the error unknown_foreground instead of an empty image. Nothing is charged.
  • A temporary failure. If processing fails on our side, you get HTTP 503 with “please retry”, and nothing is charged.
  • A retry. Send the same image with the same settings again within 10 minutes and you get the result already made, charged once. The pricing page has the details: a preview costs 0.25 credit, a full-size result 1 credit.
  • A photo that came out wrong. You can send it to POST /improve so our models can learn from it. It is free, for accounts that have bought credits.

7. What happens to your photo

Images you send for processing are handled in memory and never written to disk. The result stays in memory for up to 10 minutes, so that a retry does not pay twice, then it is deleted. Images sent for processing are not used for training: only images you choose to send to /improve are kept. The full list is in the privacy policy.

Questions

Should I use type=auto or set a type?

Use auto for a mixed set of photos. Set a type when every photo is the same kind of subject, or when the classifier got one of your photos wrong: the classification step is skipped and the photo goes straight down that path.

What does the X-Type header tell me?

The subject type that was used for the cut-out: detected with type=auto, or the one you requested. With the default type_level=1 it is person, product, animal, car or other; type_level=2 adds transportation and graphics; type_level=none leaves it out.

Does forcing a type cost more?

No. The price depends only on the size: 0.25 credit for a preview, 1 credit for a full-size result, and errors cost nothing. See pricing.

Are headshots handled differently from full-body photos?

Yes. When the face takes up a large part of the frame, the photo goes to a model chosen for portraits; full-body shots and groups stay with the model for people. Both are reported as person.

Does LassoCut handle glass and transparent objects?

There is no special glass mode, and the semitransparency parameter is accepted for compatibility only. The mask keeps partly transparent pixels, but test your own glassware on free previews before a large run.

What happens if no subject is found?

You get the error unknown_foreground instead of an empty image, and nothing is charged.

Do you keep my photos?

No. Images are processed in memory and never written to disk; a result stays in memory for up to 10 minutes for retries, then is deleted. Only images you send to /improve are kept. Details in the privacy policy.

Try it on your own photos

Drop a photo on the home page to see the cut-out, then create an account for 50 free previews a month (up to 10 a day) and check what X-Type says about your own images.

See also: portraits and hair · HD cut-outs · crop and framing · pricing.