Hacker News new | ask | show | jobs
by ajsnigrutin 1254 days ago
BMP is really great, the whole format is described on wikipedia with enough detail to code it yourself in literally 10 minutes, and the 'hardest' part of creating (or parsing) a bmp is counting the bytes to pad the data correctly, and remembering where [0,0] is :)

https://en.wikipedia.org/wiki/BMP_file_format#Example_1

1 comments

But there are lots of BMP versions - wiki says "Many different versions of some of these structures can appear in the file, due to the long evolution of this file format."
Exactly. It is easy to write a BMP reader, but if you want to read any BMP file that you might find in the wild then you're going to have a fun time.
There's even some very niche extensions to BMP which allow it to be used as a container for PNG or JPEG data.

https://learn.microsoft.com/en-us/windows/win32/gdi/jpeg-and...