Page 1 of 1
PAM (Netbpm P7) file with e.g. 12 bits is almost gray
Posted: Wed Mar 15, 2017 6:22 pm
by MortenZdk
Trying to show a simple PAM (Netbpm P7) file, the presentation is almost gray.
This looks like a bug in presentation of 12-bit files, thus with pixel values larger than 8 bits or maxval higher than 255.
The PAM (Netbpm P7) format is described here:
http://netpbm.sourceforge.net/doc/pam.html
Simple example file is attached. Note that files was packed, since I got an message that .pam file is not allowed. However, XnView does support viewing of .pam, and works find for 8 bit values.
Re: PAM (Netbpm P7) file with e.g. 12 bits is almost gray
Posted: Wed Mar 15, 2017 7:45 pm
by XnTriq
Welcome to the forum, MortenZdk.
“The picture will be converted to RGB with 8bits per component” because XnView Classic (and
MP) currently don't have full support for 12/16/32 bits.
Wikipedia (Netpbm → [url=http://en.wikipedia.org/wiki/Netpbm#PAM_graphics_format]Portable Arbitrary Map[/url]) wrote:Portable Arbitrary Map (
PAM) is an extension of the older binary
P4…P6 graphics formats. PAM generalises all features of PBM, PGM and PPM, and provides for extensions. PAM defines two new attributes;
depth and
tuple type:
- The depth attribute defines the number of channels in the image, such as 1 for greyscale images and 3 for RGB images.
- The tuple type attribute specifies what kind of image the PAM file represents, thus enabling it to stand for the older Netpbm formats, as well as to be extended to new uses, e.g., transparency.
As of 2015 PAM is not widely accepted or produced by graphics systems; e.g.,
XnView and
FFmpeg support it. As specified the
TUPLTYPE is optional; however, FFmpeg requires it.
p7_3x2_12b_3d.pam converted to PNG with XnView v2.39:
Re: PAM (Netbpm P7) file with e.g. 12 bits is almost gray
Posted: Wed Mar 15, 2017 8:57 pm
by MortenZdk
Hi XnTriq,
Thanks for attending to my issues.
I understand that XnView, and lots of other image viewers does not support more than 8 bits per layer, which is OK, since more does not make sense anyway in the presentation on a monitor.
However, my issues is merely that the image does convert correctly when the pixel components are more than 8 bits. I would expect that an image only using 0 and maxval would look the same, but that is not the case.
I have attached a number of PAM examples, going from 1 bit (maxval = 1) to 16 bit (maxval = 65535), and this shows that XnView does not handled 2 byte component values correctly, since the view changes when going from 8 bit (maxval = 255) to 9 bit (maxval = 511), where 2 bytes are required.
Can I do anything to help fixing this, since I would very much like PAM with 2 byte components to show correctly in XnView ?
Best regards
MortenZdk
Re: PAM (Netbpm P7) file with e.g. 12 bits is almost gray
Posted: Wed Mar 15, 2017 9:10 pm
by XnTriq
MortenZdk wrote:However, my issues is merely that the image does convert correctly when the pixel components are more than 8 bits. I would expect that an image only using 0 and maxval would look the same, but that is not the case.
OK, I see.
MortenZdk wrote:Can I do anything to help fixing this, since I would very much like PAM with 2 byte components to show correctly in XnView ?
Providing samples – which you've already done – is the best way to help the developer of XnView (
Pierre).
I believe he's very busy right now getting the beta of MP v0.85 out, but hopefully he'll find the time to look into this.
Re: PAM (Netbpm P7) file with e.g. 12 bits is almost gray
Posted: Thu Apr 06, 2017 3:30 am
by XnTriq
FYI: Support for the PAM format has been added in
XnView MP v0.85.
Re: PAM (Netbpm P7) file with e.g. 12 bits is almost gray
Posted: Thu Apr 06, 2017 6:23 am
by MortenZdk
Hi XnTriq,
Just tried it in XnView MP, and it works fine
Thanks for the effort
Best regards MortenZdk