I can't really find any documentation/information, so does netpbm
formats support larger max values
than 255 for color scaling and how does color scaling works anyway?

- 757
- 5
- 12
- 29
1 Answers
Originally the Netpbm formats were limited max value 1 for PBM and 255 for PGM and PPM. However, since then it has been extended to 16 bits (65536) for PGM and PPM. The accepted byte order for 16-bit raw formats is "network byte order" (most significant byte first) but not all implementations got that right, so be careful. For details, see the Netpbm_format Wikipedia page.
About the scaling: in PBM, 0 is white and 1 is black. In PGM, 0 is black and the maximum value is white. In PPM, 0 is black and the specified maximum value is fully saturated red, green, or blue for each channel, respectively.
It is up to the viewer to decide whether to interpret them in linear colorspace or some other colorspace (most applications, including browsers, assume sRGB which is supposed to be suitable for display on a monitor).

- 191,897
- 31
- 273
- 432

- 11,940
- 3
- 37
- 61