Png issue




I was playing with pixels in a png image based on colour and got something weird....


I made an image in gimp with the color values:

r:255 g: 0 b: 136 alpha: 255

r:255 g: 0 b: 136 alpha: 17

I read it into an Image, with ImageFileFormat::loadFrom,

then I look for the color values in the Image with 

Colour pixelClr = image.getPixelAt (x, y);

the resulting colours I get are:

r:255 g: 0 b: 136 alpha: 255

r:255 g: 0 b: 135 alpha: 17


I was under the impression png was lossless? why is the blue value changing from what I have in Gimp?

Should I use a different image format?




To answer it myself, I think I can't use juce for what I want to do, juce does a pre-multiply on reading the png file, and then an unpremultiply on reading the pixel, and that's a lossy operation. :(


guess I'll have to add another imagelibrary into the mix to keep a shadow copy with the un-multiplied alpha values.