PPM (binary) Graphics format:
P6
width height
max-value-per-component
<binary data> (RR GG BB RR GG BB ...)
The first 3 lines are strings
Example:
P6
1024 1024
255
FF FF FF 80 23 4D ... (binary)
You must have 1024*1024 bytes in binary to match the width and height.
You can change P6 to P3 and write RR GG BB in decimal string:
P3
1024 1024
255
255 255 255
128 34 77
... (strings)
See netpbm format