codex/site-src/netbpm.wtn

26 lines
970 B
Plaintext

* Netbpm formats
The Netbpm formats are a series of very simple image formats. It is divided
into three types, with two variants each. The first variant stores its data in
human readable ASCII format, while the other stores the data in a binary (raw)
format.
The first of the three different types are the Portable BitMap format which is
able to store 1-bit images. The second is the Portable GrayMap format, with the
ability to store gray scale images with ranges from 0-255 or 0-65535. The last
format is the Portable PixMap format which stores a range from 0-255 for each
RGB channel.
The formats have a similar structure:
``
P3 # Magic value. P1 corresponds to BitMap, P2 to GrayMap, and P3 to PixMap.
# P4-P6 are for the binary variants.
800 600 # Width and height of the image.
255 # The maximum value for each colour. This marks the end of the header.
# The rest of the file is the actual image data.
255 0 0
255 255 255
...
``