Bug on alpha channel removal?
lucch opened this issue · comments
I'm getting strange results trying to convert an RGBA8
to RGB
.
Here's my code:
main :: IO ()
main = do
Right rgba <- readImage "lion-rgba.png"
let rgb = convertRGB8 rgba
writePng "lion-rgb.png" rgb
And the images used.
(1) Input image ("lion-rgba.png"):
(2) Resulting image ("lion-rgb.png"):
Is this a problem with Juicy.Pixels, my code or the image? 😅
well convertRGB8 just strip out the alpha layer, the color value behind transparent can be anything, in that case: an extruded lion. To get what you want you should maybe special case and perform a proper alpha blending against a background of your choice (There is no helper in the library for that).