I’m trying to write a very simple image processing program for fun and practice. I was using System.Drawing. … .Bitmap class to handle images and edit their data. but now I want to write my own class of Bitmap object implementation and want to know how bmp files (and other common bitmap formats) and their meta-data (indexing, color system & etc) are stored in files, and how to read and write them directly?
Share
The BMP file format is a simple one, you’ll have little trouble creating your own. But you’ll hit the wall on a compressed format like PNG, TIFF or JPEG. Nobody writes an encoder for these, there are well established reference implementations for them. They are written in C, the universal language for libraries like these.
Google “libpng”, “libtiff” and “libjpeg” to find them. You’ll need a C compiler to turn them in a DLL that you can P/Invoke.