English | German

Hi, I'm Nicolas Hollmann and this is my personal site and blog.
Happy reading! 📖

Binary file formats introduction

August 14, 20191 min read

This article is just an introduction to a complete series of articles about binary file formats.

In this series we will learn about the structure of many different binary file formats and how to read and write them. First we will focus on writing various binary image file formats, because we can use this knowledge in many projects on this blog.

But why should you be interested in such formats? Today the most data is either in XML or JSON and if I really need to write a binary file there is definitely a library to do so, right?

Yes, exactly. And you should use them! They are well tested and have many more features than anything we will build in this series. But using something doesn’t mean that you really understand it. That is, if you want to understand it at all. I was fascinated about the inner workings of ANYTHING since I was a young boy. And there is no better way in understanding something than building it yourself. Your implementation doesn’t even need to be perfect or well optimized. As long as your implementation works it’s good enough.

If you’re not as that interest in the inner workings of some of the most common file formats we use every day, then this series will just bore you and you shouldn’t read it.

But if you’re at least a little bit like me I will take you to a journy of understanding some of the genius techniques used in everyday file formats. We will first look at the simpler formats like Portable Anymaps and Bitmaps and then gradually go over to the more complicated formats. While we first stick to images, I plan to look at other formats like .tar or .zip Archives later.

The article about the byte order which will come out soon is the foundation of many other articles in this series.

So stay tuned!

© 2021, Nicolas Hollmann