I'm using Python and PIL to create a non-transparent RGB image and save it as PNG format.
But when I display it, the RGB values of each pixel change around correct ones. (I tested using screenshot with no scale and print out the RGB value of the screenshot) And the RGB values of original image is exactly correct, only those in its screenshot change.
im = Image.new("RGB",(length,length),"black")
set RGB value for certain point
im.save(image.png,"PNG")
However, if I create the RGBA format, without setting any A value, also save it as PNG format, the RGB values on the screenshot of this image is exactly correct.
im = Image.new("RGBA",(length,length),"black")
set RGB value for certain point
im.save(image.png,"PNG")
I'm wondering why there happens the difference since it is not a transparent image.
I asked it on Quora and discussed with someone who told me it is not the issue/feature of PNG.
So I'm wondering if it is the problme of PIL or it is a problem when system displaying an PNG file without Alpha channel.
P.S. I'm using PNG image as a media to transfer file, so the RGB value should be exactly correct to decode.
and in case you need to see all my code: http://ift.tt/1w3d4rx
Thanks!
Aucun commentaire:
Enregistrer un commentaire