Try to cut somebody out of a photograph with a background remover that works by colour and you will meet the same two failures every time. The white of the wall goes, and so does the white of their shirt, the white in their eye and the highlight on their glasses, because the tool is comparing colours and a colour does not know which object it belongs to. Then, wherever the edge runs through hair, the hair is simply gone, shaved off at whatever line the threshold happened to fall on.
Both failures come from the same decision, made before any pixel is examined. A colour key asks a yes or no question of every pixel: is this close enough to the background colour. There are pictures where that question has an answer, chiefly a product on a lit sweep in a studio. For anything else it does not.
The honest answer for a pixel that a strand of hair passes through is not yes and not no. The strand covers perhaps a third of that pixel, so the pixel is one third hair and two thirds whatever was behind it. Any tool that must answer yes or no has to round, and rounding is what destroys the edge.
Coverage instead of membership
The field that takes the fractional answer seriously is called matting, and it has been the standard approach in film compositing for decades. Instead of a selection it produces an alpha channel: one number per pixel between zero and one, saying how much of that pixel belongs to the subject. A network trained with a matting loss learns to output those in between values rather than being punished for them.
The tool below runs two such networks, and it does not choose between them for you, because they answer different questions. Everything happens in this browser tab: the weights come down from this site the first time you press the button, and your picture never goes anywhere.
Cutout with soft edges
A cutout made by colour cannot tell white fur from a white wall, so it punches holes in the subject and shaves the hair off the edge. These two small networks answer a different question: not what colour a pixel is, but whether it belongs to the subject. The portrait model weighs about 4.9 MB, the general one about 4.0 MB, and both share a 3.5 MB runtime with every other model tool on this site. Your picture is read in this browser tab, never uploaded, and there is nowhere for it to be uploaded to.
or press Enter to pick one. JPEG, PNG or WebP.
Sample picture, drawn in this browser.
Anything longer than 2048 pixels on its long edge is scaled down to that before the model sees it. The alpha map the model returns is much coarser than the picture anyway, so the pixels above that size cost time and buy nothing.
White is kept, black is dropped, and every grey between them is a pixel the model was not certain about. That grey band is the whole difference between this and a colour key, so it is worth looking at once.
MODNet, trained on photographs of people. It returns a soft alpha channel with genuine in between values along hair and fur, which is the part no threshold can produce. On a chair or a packshot it finds nothing sensible.
The alpha map is pulled through a curve before it is applied: everything below 0.5 minus half the width becomes fully transparent, everything above 0.5 plus half becomes fully opaque, and the rest is stretched between them. At 1.00 nothing changes and the soft gradient survives, which is the setting to start from.
| What happened | Value |
|---|
What this deliberately cannot do. Neither model gets glass, smoke or a veil right, because both answer with one number per pixel and those things are not one number. MODNet looks for a person, so on a chair, a bottle or a plate of food it returns something that looks like an answer and is not one. U2-Netp always finds a subject, even in a picture that has none, and it decides at 320 by 320 before the result is stretched back up, so its edge is approximate by construction. And a soft alpha channel is not a promise of a clean edge: it is an estimate, and on fine hair in front of a busy background it is visibly wrong. Comparable tools exist, several of them good. What is different here is the mechanism: the weights come down once and the picture stays in the tab.
Why there are two of them. They were trained to answer different questions. MODNet was trained on people against real backgrounds with a matting loss, so it learns the partial coverage of a pixel that hair passes through, and that is why its output has genuine grey values rather than a hard border. U2-Netp was trained to find whatever is salient in a picture, which is a broader and blunter question, and it is fixed at 320 by 320. Neither of them is a better version of the other, so the tool does not choose for you.
Why there are two models and not one
The first is MODNet, trained on photographs of people against real backgrounds. It is the one that produces genuine grey values through hair and fur, and it is the reason this tool exists at all. It is also, and this matters, a portrait model. Shown a chair, a bottle or a plate of food it returns something that looks like an answer and is not one, because it was never taught what those are.
The second is U2-Netp, a saliency model. Its question is broader and blunter: which part of this picture is the subject, whatever the subject happens to be. It will find something in almost any photograph, which is useful when the subject is not a person and misleading when the photograph has no clear subject at all. It also works at a fixed 320 by 320 and its map is stretched back up afterwards, so its edge is approximate by construction.
Neither is a better version of the other. If the subject is a person, use the portrait model and you get an edge no threshold can produce. If it is anything else, use the general one and accept a coarser boundary. The tool leaves that decision where it belongs.
What the models are actually shown
Neither network sees your picture at the size you dropped in. The portrait model is fed at a fixed short edge of 512 pixels with both dimensions rounded up to a multiple of 32, and its pixel values are shifted from the usual range of nought to one into minus one to one before it sees them. The general model is fed at exactly 320 by 320, normalised with the same per channel means and deviations that most models trained on ImageNet expect.
Those are not arbitrary choices and they are not this tool’s inventions: they are the conditions each network was trained under, and feeding a model normalised differently from its training produces output that looks broadly plausible and is quietly wrong. It is one of the more common ways a working model produces bad results in a new setting, and it leaves no error message behind.
What comes back in both cases is a single channel map at the size the model worked at, which is then stretched back up to the picture. That is the second reason the general model’s edge is coarse: a 320 pixel map spread across a 2000 pixel photograph has one model value for every six or so pixels of yours, and the smoothness between them is the browser’s interpolation rather than the model’s opinion.
Look at the alpha channel
The single most useful control in the tool is the one that looks least useful: the checkbox that shows the alpha channel as a grey image. White is kept, black is dropped, and everything in between is a pixel the model was not certain about.
Do that once on a portrait and the whole idea becomes obvious. The body is solid white. The background is solid black. Around the hairline there is a band of grey twenty or thirty pixels deep, and that band is the entire difference between this and a colour key. A colour key produces an image with no grey band at all, which is why its results have that cut out look even when the selection was accurate.
It is also the fastest way to tell whether a cutout is going to work before you spend any time on it. If the grey band is thin and follows the subject, the result will be good. If there are grey patches out in the background, or a hole of grey inside the subject, the model is uncertain about something and no amount of adjustment downstream will fix it.
What the edge dial actually does
The alpha map is pulled through a curve before it is applied. At the default of 1.00 nothing happens: the soft gradient survives exactly as the model produced it, and that is the setting to start from and mostly to stay at.
Turning it down narrows the band in which values are allowed to be uncertain. Everything below the lower bound is forced to fully transparent, everything above the upper bound to fully opaque, and only what lies between them is stretched across the range.
width = the dial, from 1.00 down to 0.05
low = 0.5 - width / 2
high = 0.5 + width / 2
alpha' = clamp((alpha - low) / width, 0, 1)
At the bottom of the range you have reinvented a threshold, deliberately. That is occasionally what you want: a hard graphic edge for a logo, or a subject you intend to place on a flat colour where a soft edge would look like a halo. Most of the time turning this dial down is throwing away the thing you came for.
Putting the cutout onto something
A cutout with a real alpha channel has to be saved as PNG or WebP. JPEG has no alpha channel at all, so exporting a cutout as JPEG silently fills the transparency with black, which is a surprisingly common way to lose an afternoon. If you are unsure which of the formats to reach for here, PNG is the safe answer and WebP the smaller one.
Compositing onto a colour is arithmetic rather than magic, and the tool does it for you when you pick a background, but it is worth knowing the line because it explains the halo problem:
result = subject * alpha + background * (1 - alpha)
A pixel that is half covered contributes half its own colour and half the new background. That is why a subject cut from a photograph taken against a dark wall looks slightly wrong on white: the partially covered pixels along the edge still carry some of the dark wall, and they always will, because that colour is genuinely in them. Nothing here can remove it. What helps is picking a background of a similar brightness, or, if you are placing the subject on a page, giving it a shadow that makes the join plausible rather than trying to make the join invisible.
A cutout is rarely the last step
The moment a subject is free of its background, a second problem appears that the cutout cannot solve. The lighting on the subject came from the scene it was photographed in, and the new background it lands on has its own implied light. A person lit from the left, placed on a background whose light clearly comes from the right, reads as wrong long before anyone can say why.
That is worth knowing before you spend an hour perfecting an edge. If the composite is going to fail on lighting, the edge quality will not save it, and the fix is to choose a different source photograph rather than a different cutout tool. The same reasoning runs through product shots that look assembled rather than photographed, where the giveaway is almost never the outline.
What this deliberately cannot do
Glass, smoke and a veil defeat both models, and they defeat them for a structural reason rather than a quality one. Each model answers with a single number per pixel, and a pixel showing a red shirt through a green bottle is not describable by one number. Proper handling of that needs colour unmixing, which is a different problem with a different shape of answer.
The portrait model finds people, so on a product shot it returns confident nonsense rather than an error. The general model finds a subject even in a picture that has none, and decides at 320 by 320 before its answer is stretched back up. And a soft alpha channel is an estimate, not a guarantee: on fine hair in front of a busy background it is visibly wrong, and the grey view will show you that it is wrong before you notice it in the result.
Anything longer than 2048 pixels on its long edge is scaled down before the model sees it. The alpha map is much coarser than the picture anyway, so the pixels above that size cost time and buy nothing.
Where this fits
Comparable tools exist and several of them are good. The mechanical difference here is that the weights come down to your browser once and the photograph stays in the tab, which matters more for some pictures than others. There is also a real limit to what any single model does: this is one step in a process that also includes deciding what your selection should even contain, and for a shop the answer is usually shaped by the sizes the platform is going to generate rather than by the cutout itself.
The lesson worth carrying away is not that a model beats a threshold. It is that the threshold was answering the wrong question. Once you accept that the correct answer for an edge pixel is a fraction, most of what looks like magic in a good cutout turns out to be arithmetic, and most of what looks like failure in a bad one turns out to be a model that was asked about something it had never seen. Looking at the grey image tells you which of the two you have, every time, in about a second.