You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both the image preview and saved PNG show a 15x7 greyscale image with the letters "PIL", where the "P" is dark grey, the "I" light grey and the "L" is white. This is what I see if I load the "pil.pgm" in other software, such as Ubuntu's file manager, image viewer, ImageMagick and GIMP.
What actually happened?
The PIL letters are all really dark grey.
Pillow only uses the "11" maxval to determine how many bytes to use for each pixel. E.g. a value of 10000 makes it use 2 bytes per pixel. It does not use it as the maximum value. It uses 255 as the maximum instead.
Similarly, with 16-bit grey values, the maximum is always 65535.
The same happens for the RGB P6 format. The maxval is only used to determine the bit depth.
What did you do?
What did you expect to happen?
Both the image preview and saved PNG show a 15x7 greyscale image with the letters "PIL", where the "P" is dark grey, the "I" light grey and the "L" is white. This is what I see if I load the "pil.pgm" in other software, such as Ubuntu's file manager, image viewer, ImageMagick and GIMP.
What actually happened?
The PIL letters are all really dark grey.
Pillow only uses the "11" maxval to determine how many bytes to use for each pixel. E.g. a value of
10000
makes it use 2 bytes per pixel. It does not use it as the maximum value. It uses 255 as the maximum instead.Similarly, with 16-bit grey values, the maximum is always 65535.
The same happens for the RGB P6 format. The maxval is only used to determine the bit depth.
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: