Quote:Original post by Horatius83
Unless you're developing some wickedly brilliant compression scheme I would have to agree with the above posts, existing formats have most of the major bases covered. In the end you'll either have an index value pointing to a color table for each pixel, or you'll have so many bits dedicated to various color channels per pixel. Even with compression it will stil have to be converted to an array of color values at some point, so I would save my effort for more interesting problems.
I concurr with both this, and the moderator's post, with one exception:
sometimes you've just gotta do things to understand how they work. I know it's easy enough to grab libpng or libgd or what have you, but for some people it's just not enough to read about how something works, but you just have to get your hands on it and know the raw feeling of what it takes to compress an image.
That being said, I used to do a lot of this kind of thing when I was playing around with compression years ago. It can be as simple as indexing color values, to run length encoded images to B&W transforms to fourier transforms; it's a good way of learning all of the various algorithms and mathematical steps of doing it, just don't fool yourself into thinking that they're any better than something that currently exists unless it really really is better (which is highly unlikely) and definitely if you're writing a game or something, don't use it.
So, to recap: unless you just want to experiment with image compression, you've really got no business writing your own image format. It only stresses yourself and others out, and the end result just isn't any better than anything on the market already.