How hard would it be to make a custom file format?

Started by
1 comment, last by Mman 22 years, 3 months ago
Yeh, how hard would it be to make a custom file format for a picture file? What would be some info that I would have to include? Any ideas welcome! Thanks.
Advertisement
Not very. It really depends on how felxible you want your format to be. If you want simplicity, go for a simple 24 bit file, and store height, width, followed by the raw data(a single 32 bit value per pixel, ignore one byte). You could then extend it, to NOT store that unused byte, to save height*width bytes in the file.

If you wanted to a bit more flexible, you would store the bpp in the file, perhaps the size for data checks, etc.

Z.
______________"Evil is Loud"
nowadays resolutions are quite high, and the amount of pixels you might want to add can be quite a lot, most modern file formats have some compresion scheme, this would make your file format more complex, but I am sure you wont want 2 MB(or more) 640X480 bitmaps.

This topic is closed to new replies.

Advertisement