4 ms·
Applying a blur filter to a premultiplied image is (very subtly) _correct_, at least if the goal is to emulate what happens if you used a physical lens to blur
by Sesse__ 4y ago
Applying a blur filter to a premultiplied image is (very subtly) _correct_, at least if the goal is to emulate what happens if you used a physical lens to blur the same image. Not only does postmultiplied alpha mess up the correct pixel values (as the original post shows), but even without alpha, you get a “halo” that is weird and unphysical.
- im3w1l 4y agoI think corysama had the right of it, you need to do all the operations in linear colors, i.e. original image -> convert to linear color space -> multiply alpha -> blur -> composite -> possibly convert back to sRGB if needed The wrong way I meant was original image -> multiply alpha -> gamma-correct-blur -> composite where gamma-correct-blur = convert to linear color space -> blur filter -> convert to sRGB