Closed punctuations closed 1 year ago
How does it know what color was supposed to be there? What about fully transparent pixels?
because the channels are broken up into rgba values like so:
rgba(255, 255, 255, 0) <-- (using CSS notation to visualize) This conversion essentially just removes alpha channel, transparent pixels will just be pixels that have an alpha value of 0, they will have a colour set by default so it will just have it has that
I'm worried the backgrounds will go white (e.g. 255, 255, 255, 0), instead of black.
Can you test with some of our gifs and other transparent content? SVG, etc?
I mean it will if the pixel states that its a transparent white pixel, do want me to just replace all fully transparent pixels with black pixels?
Yes, if it's easy, that would prevent some unwanted surprises
I made a change to go back to using the old way in that case, to just have a black background instead.
If I remember correct the actual problem wasn't removal of transparency per say but it just needed a black background so you didn't see the other images behind it?
If this was the issue this commit will fix as the only thing I changed from the original (before this issue) was checking to make sure both modes are the same (which is why the image in the issue was failing), the image in the original issue was a .png
but without an alpha channel meaning it had its mode as RGB
, whereas it was being pasted on an image (all back to act as a background) that has the mode of RGBA
, throwing a transparency mask error. < -- This issue has been fixed in the latest commit.
Excellent. Please test it with a transparent gif as well, to make sure that process wasn't broken
I did, a fully transparent gif will just be all black
DESCRIPTION:
Fix png transparency, in this it will also now basically just remove alpha channel and keep whatever colour was supposed to be there (just without transparency)
TECHNICAL CHANGES:
.convert('RGB')
RELATED ISSUES: