Which resize calls mix hidden transparent colour into cutout edges
A developer wanted to know which browser and Node image-resize calls blend the colour stored under fully transparent pixels into semi-transparent edges. Using one cutout portrait and a tiny synthetic test image, they compared canvas drawImage, createImageBitmap with and without premultiplied alpha, and sharp's default resize. Canvas kept the edge clean, while createImageBitmap with premultiplyAlpha set to none produced a purple fringe from the hidden blue. Sharp's default and split-channel resizing gave noticeably different edge colours, so the results depend on which call is used.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in