I'm looking for a raw image file format as simplistic as PGM, but encoded in binary, so that I can write pixels in bursts. I've searched over Wikipedia and Google and found none that didn't start to have complex headers and such. Can anybody recommend me such a type of a file format?
Asked
Active
Viewed 3,284 times
2
-
1Why can't you use PGM in binary ('P5') mode? See http://netpbm.sourceforge.net/doc/pgm.html – Harald K Nov 02 '14 at 08:17
-
Sorry, I only saw P2. Thank you. – Catalin Vasile Nov 04 '14 at 09:04
1 Answers
2
One easy way is to use the PGM format itself, in 'P5' (binary) mode. See PGM format from the Netpbm documentation. Set maxVal
to 255, to use the full 8 bit range.
This is probably the most common format for PGM, as it is extremely easy and fast to both read and write.

Harald K
- 26,314
- 7
- 65
- 111