Image Processing
Bits to Bitmaps: A simple walkthrough of BMP Image Format
In this article, we will go through simple concepts of Bitmap image format and understand how we can assemble simple BMP images from binary data in memory
I was working on a Medium article to discuss Typed Arrays in JavaScript and how to create and manipulate in-memory Data Structures. Basic Text Encoding is a sweet example to handle binary data but I wanted a little complex demonstration of creating well-known file formats.
Since Bitmap or BMP is a lossless and uncompressed image format and it felt natural to encode a BMP image for demonstration. Unlike plain text encoding, BMP is complicated because of the so-called required metadata.
My first thought was to; understand how BMP encoding works, so I went on the “internet”. It took painstaking hours to discover something useful. By doing trial-and-error, I finally arrived at some conclusions.
In this article, we will discuss what BMP image is consists of, what are the encoding parameters of the BMP image format and how we can create some simple BMP images just by playing with binary values.
Disclaimer: The concepts discussed in this tutorial…