Expand description
Netpbm P6 (binary PPM) encoder.
PPM stores RGB 8-bit pixels. Pixel modes that are not natively RGB are converted on the fly:
| Mode | Conversion |
|---|---|
Rgb8 | verbatim |
Bgr8 / Xbgr8 | channel swap |
Cmyk8 | R = 255−C−K, G = 255−M−K, B = 255−Y−K (clamped) |
DeviceN8 | CMYK portion only (same formula) |
Gray8 / Mono8 | not supported — use write_pgm |
Mono1 | not supported |
The output is a standard P6 header followed by raw RGB bytes.
Functions§
- write_
ppm - Write
bitmaptooutas a binary PPM (P6) image.