This is my issue:
import Image
im = Image.open("1.png")
im.show()
print im.mode
im.convert("RGBA").save("2.png")
Well, with my image you can see the difference.
My question is: how do I convert it properly?
Image:
Result:
NOTE: The original image has a semi-transparent glow, the result has a solid green "glow"
This issue was reported here:
https://bitbucket.org/effbot/pil-2009-raclette/issue/8/corrupting-images-in-palette-mode
In March 2012, a comment says it's now fixed in development version of PIL. The most recent released version is 1.1.7, so the fix won't be available until 1.2 comes out. PIL updates very slowly, so don't expect this to come out soon.
Unfortunately your PNG image is a type that PIL doesn't handle very well - a paletted image with an alpha channel. When you open the image, the alpha is thrown away and there's no way to get it back.
This is different from the usual palette transparency where one index of the palette is used to denote fully transparent pixels.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With