youve probably noticed the post i made about 'beginner array question', well, heres why:
im working on a program that takes a black and white image, saves it as an array of 0s and 1s, and then compresses that array as small as it can go..
i thought of different ways to compress it, but since this is my first attempt at compression, i tried a simple method..
since my array was only 0s and 1s, i thought about converting each character into a bit... so i can could reduce the size of the file by 8, anyway, that went successfully... but i was wondering, is there any other method i can use to compress the string even further?
i know that my method is simple because the compression ratio is just pathetic compared to the RAR or ZIP compression ratio, so i did a little digging on google.. i found out they use the LZW (im thinking method?) to compress their data to such small sizes.. i did even more digging, and i found out it uses some sort of a dictionary, and that its a lossless compresser.. anyway, i looked up a few implementations of the LZW algorithm and i wanted to ask this, before i went any further:
should i use both my method and the LZW algorithm? and in which order? (i.e. divide by 8 then compress with LZW? or visa versa?)
or is there another compression algorithm that does this already?
if someone could point me in the direction of any such algorithm, it would be much appreciated