Skip to main content

Module ppm

Module ppm 

Source
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:

ModeConversion
Rgb8verbatim
Bgr8 / Xbgr8channel swap
Cmyk8R = 255−C−K, G = 255−M−K, B = 255−Y−K (clamped)
DeviceN8CMYK portion only (same formula)
Gray8 / Mono8not supported — use write_pgm
Mono1not supported

The output is a standard P6 header followed by raw RGB bytes.

Functions§

write_ppm
Write bitmap to out as a binary PPM (P6) image.