If we take, say, 32-bits per pixel pictures using ARGB and ARGB_PRE (ARGB but with premultiplied alpha), are the values identical when the alpha is fully on (that is: no transparency at all)?
For example if I have an ARGB pixel with the following value: 0xFF808080 (which is a shade gray, without any transparency because the alpha is at its max value: 255), what would this become in ARGB_PRE?
How can I find this out by myself? Is it enough to instanciate one buffered image using ARGB and the other ARGB_PRE and using setRGB(...) on both and then comparing the int I'd get back?
For example if I do this:
final BufferedImage bi1 = new BufferedImage(10,10,BufferedImage.TYPE_INT_ARGB);
final BufferedImage bi2 = new BufferedImage(10,10,BufferedImage.TYPE_INT_ARGB_PRE);
bi1.setRGB(0,0,0xFF808080);
bi2.setRGB(0,0,0xFF808080);
System.out.println("bi1: " + Integer.toHexString(bi1.getRGB(0, 0)));
System.out.println("bi2: " + Integer.toHexString(bi2.getRGB(0, 0)));
I get back the same value for both, but it's normal it's the very value I gave.
Basically my question boils down to this: if pictures doesn't have a single pixel being transparent, can I generate the exact same pictures by using the exact same values both in ARGB and ARGB_PRE modes?
Or formulated this way: if I don't have any transparent pixel, are ARGB and ARGB_PRE basically identical?
Premultiplied alpha means that colors stored in the image data are multiplied by alpha, so they dont need to be multiplied when composing(drawing). this doesnt change how image looks when drawed, but how it's data is stored...
BTW if your image only has alpha values of 255 (255 in composing means 1.0f) then resulted color will always be 1 * color = color (not changed)