Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.7.2
-
None
Description
The PPM (P6) image format allows to specify the maximum color value, which is usually 255 for 8 bit images, and 65535 for 16 bit images. The PPM loader has two bugs when scaling values where max is not 255.
First, when max < 255 it does not scale at all, making images look too dark.
Second, when max > 255 it scales the 0 value to -1, resulting in 255 when packed into qRgb. Attached is a 16 bit PPM image (max = 65535) that has only red pixels (rgb FFFF 0000 0000, but is loaded as white (rgb FF FF FF).