Drop a background-removed image onto a dark page and you often get a thin white halo around the subject. I went through the usual advice for killing it: re-export as PNG, shrink the edge, feather the mask, or turn on the "remove background color fringe" option. I measured each one instead of eyeballing it. Only the last one really removes the halo, and it does so by making parts of the subject transparent.
The samples are two white-background photos from Wikimedia Commons: a puppy by George Hodan (CC0) and a bottle of plant cuttings by Biusch (CC BY-SA 3.0). The plant has leaves with cream-white patches, which mattered later. For the cutouts I used ImgIng (https://imging.ai/) on its fast model, ISNet INT8, running in the browser, and I composited every export onto pure black. Across six exports the page sent zero non-GET requests. Its refine panel says the default export uses the AI output pixel by pixel and changes neither transparency nor edge color, so the default file is a clean baseline of what the model itself produced.
To put a number on it, I composited every semi-transparent pixel (alpha 1 to 254) onto black and averaged its brightness. Then I estimated what that edge should look like using the color of the opaque pixels just inside it, and took the difference. Bigger means a stronger halo. The estimate is rough, so I only use it to compare settings. On the default export the puppy came out 11.1 too bright and the plant 11.6. In the raw pixels, the puppy's semi-transparent ring averages 160.1 in brightness while the fur right next to it averages 108.6. The white of the old background is baked into the soft edge.
Switching formats did nothing. The WebP and PNG exports had exactly the same semi-transparent pixel count, 113,438 on the puppy, and their average brightness differed by 0.2 at most. The only real difference is size: the puppy PNG was 1,338,889 bytes against 109,722 bytes for the WebP.
Edge shrink is a slider from -4 to 4, and I had the sign backwards at first: positive pulls the edge in, negative pushes it out. Pulling in by 1 helped a little on the puppy, from 11.1 down to 8.4, at the cost of trimming the subject from 503,980 opaque pixels to 491,682. Pushing out made it worse, 15.8 at -1 and 19.8 at -2. On the plant, +1 gave 11.5, basically unchanged. Feathering was no help either. The puppy got 11.7 at 1 px and 13.4 at 3 px, and the plant got 11.2 at 3 px.
This is the underside of the puppy's belly on black, enlarged 3x, with default, shrink +1 and shrink -2 from left to right. Honestly the three look almost identical. The one thing you can spot is a thin bright line along the bottom of the -2 version, which is background white pulled back in by expanding the edge. The numbers sound far more dramatic than the picture looks. Original photo by George Hodan on Wikimedia Commons, CC0.
The fringe-removal toggle is off by default and labeled as optional and something that changes the original AI edge. With it on, the puppy's gap dropped to 0.4 and the halo was gone. Judging by the output, it works on transparency rather than color. 76,236 puppy pixels got a new alpha, while not a single opaque pixel shifted in color by more than 30. That trade has a price wherever the subject itself is close to the background color. It also left a jagged hard edge where the puppy's front leg meets its belly.
Look at the right panel, where fringe removal is on. Large parts of the upper leaf have gone black because they became transparent. Of the 208,058 visible pixels in that leaf region, 151,728 were already semi-transparent in the default export, so the fast model had treated the pale leaf as partly see-through to begin with. With fringe removal, 41,644 of them went fully transparent. Original image from Wikimedia Commons by Biusch, licensed CC BY-SA 3.0; this comparison is a composite of the cutout and is likewise released under CC BY-SA 3.0.
The glass bottle was the case I could not fix. By default it wears a grey-white glow about 20 px wide. Fringe removal clears the glow but turns the rim into stair-steps, and shrink or feather cannot touch it because the glass really is semi-transparent.
So my rule now depends on the subject. If it is opaque and far from the background color, I turn fringe removal on and then zoom into the joints to check for jagged bits. If it has pale areas close to the background, I leave it off and try shrink +1 instead. Glass I have no good answer for yet. All of this is the fast model on white backgrounds, with shrink tested at +1, -1 and -2 only. Before a cutout goes on a dark page, composite it onto black and zoom in on the edge first.

Top comments (0)