-
I have a program that, in the course of doing its function, stores files at the bit level hidden in a windows bitmap.
The program reads the entire bitmap in memory and the entire file in memory then does its work then spits out the new bitmap.
The thing is i would like to be able to compress the file before inserting it, and uncompress it again later. It doesn't have to be a super compression routine. But for obvious reasons, it can't be a lossy one. I thought of the old "find a common string and replace with a marker" but i have no clue of how to search the file fast enough to accomplish this in a reasonable amount of time.
Does anyone have any source code in vb for a simple compression routine (preferred) or a not-so-simple one i can puzzle over?
For more obvious reasons, i'd like it to be a free compression routine.
Anyone got one?
-
zLib is free, and the algorithm it uses is well documented in the RFCs :) Unfortunately, it definitely takes puzzling over :( There's the new bzip as well...not sure how that compares -- could be interesting to look at.
-
If you want to impliment your own, search the net for LZ77 and LZ78, these are fairly straight forward algorithms that you can use yourself, LZW is better and used in GIF but it needs to be licensed so if your selling your app you could get into hot water with Unisys.
I'm working on a few similar things at the moment.
-
do you have a link to zlib or the docs?
I'm staying away from the .gif one for that very reason.
Hence i asked for a "free" one.
-
www.libpng.org and follow the zlib link.