Binary file formats
Raw PBM row planner
Calculate P4 bitmap row padding, raster bytes and canonical file size.
Your inputs
Start with an exampleYour result
Example resultAa — A small example of your colors.
How it works
Each row packs one bit per pixel and rounds up to a full byte. Add the ASCII P4 width/height header for canonical file size.
10×3 pixels need two bytes per row, six raster bytes and an eight-byte header: 14 bytes total.
Limits
P4 only, with the generated comment-free LF header. Row-end unused bits are not additional pixels. P1 ASCII and multiple-image files are excluded.