Hi,
I noticed that the raw PNM formats (both PGM "P5" and PPM "P6") that have MAXVAL=65535 are displayed incorrectly. I believe you somehow get the endianness wrong, because I'm seeing the least-significant 8 bits from the 16-bit image.
If MAXVAL is anything less than 65535, or if the format is text ("P2" or "P3"), everything works fine.
The problem exists both in XnView and NConvert.
Best regards,
Cosmin
Incorrect display of 16-bit raw PNM
Moderators: XnTriq, helmut, xnview
Pierre, here is a sample:
http://cosmin.users.sourceforge.net/tes ... 6g_lin.pgm
http://cosmin.users.sourceforge.net/tes ... 6g_lin.png
This is Lena in grayscale, downscaled and converted to 16-bit linear colorspace.
The PNG file was created out of the PGM file using OptiPNG. Any other common PNM-to-PNG converter would give you the same (correct) PNG output. The PNG image is displayed properly in XnView, but the PGM image is garbled.
The same happens with PPM images. If you want a PPM sample as well, please let me know.
I hope this helps.
Best regards,
Cosmin
http://cosmin.users.sourceforge.net/tes ... 6g_lin.pgm
http://cosmin.users.sourceforge.net/tes ... 6g_lin.png
This is Lena in grayscale, downscaled and converted to 16-bit linear colorspace.
The PNG file was created out of the PGM file using OptiPNG. Any other common PNM-to-PNG converter would give you the same (correct) PNG output. The PNG image is displayed properly in XnView, but the PGM image is garbled.
The same happens with PPM images. If you want a PPM sample as well, please let me know.
I hope this helps.
Best regards,
Cosmin