{
  "id": 11635294,
  "title": "Premultiplied alpha didn't remove my cutout's white fringe",
  "url": "https://urgent.news/2026/10/03/premultiplied-alpha-didnt-remove-my-cutouts-white-fringe",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-03T08:01:27.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/pm_cheng_3f36acecfb9c59f5/premultiplied-alpha-didnt-remove-my-cutouts-white-fringe-p6n"
  },
  "original_language": "en",
  "account": "Premultiplied alpha did not eliminate the white fringe around cutouts. The usual solution, compositing with premultiplied alpha, didn't help when measured. The fringe appeared as a luminance of 75.4 on the test cutout, both with straight-alpha and after converting to premultiplied. The white wasn't a compositing artifact but stored in the edge pixels. The experiment used two white-background photos from Wikimedia Commons and a ficus cuttings in a glass bottle. The cutouts were generated using ImgIng on its fast tier, and both straight and premultiplied PNGs were compositing onto black for measurement. The matting model and edge options were not built by the user, so they were inferred from exported files. Straight alpha keeps a pixel's color and opacity as separate values, while premultiplied alpha stores the color already multiplied by opacity. PNG requires straight alpha, but canvas and GPU pipelines often work premultiplied internally. Mixing them caused the white fringe. The fringe pixels had an average luminance of 160.1, while the opaque fur just inside the edge was at 108.6. Every fringe pixel with alpha between 128 and 254 was within 2 of the source color, and all opaque pixels were the same. The white fringe came from the hair-thin edge where the subject color mixed with the white backdrop. The fringe was fixed by changing the data, removing the mix between the subject color and the mix. ImgIng's decontamination toggle separated the subject color from the mix but pushed the pale variegated leaf toward transparent, causing holes over black. To fix the white fringe, check if the blend formula matches how the file is stored, and if the math is right, examine the subject before enabling decontamination.",
  "summary": "A background-removed PNG dropped onto a dark page often shows a thin grey-white rim. The usual advice is to composite with premultiplied alpha. I expected that to help, measured it, and it changed nothing: on my test cutout the fringe averaged a luminance of 75.4 over black with the straight-alpha formula, and exactly 75.4 again after converting to premultiplied first. The white is not a…",
  "key_points": [
    "Premultiplied alpha didn't remove white fringe around cutout",
    "White fringe appeared as luminance of 75.4 on test cutout",
    "Fringe fixed by changing data to separate subject color from mix"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}