A new compression algorithm?!

compress-mdI started a project yesterday. The idea is quite simple take some data and embed it into an image. The size of the image directly correlates to the data that you can embed in it. So during my testing I have created a RAR archive with maximum compression level and embedded it into a PNG image.

I tried to keep everything simple and the algorithm follows the following steps:

  • Store size of data in bytes, so we have to convert int to an array of 4 bytes. Easily done with the help of BitConverter
  • Store the name, again the data needs to be converted to bytes

Nothing to be excited about so far.

However once I embedded the already compressed data in RAR format into a PNG image, the size has reduced even further, by 20%! Since PNG is a loss-less format, my only explanation is it does some compression using how the pixels are arranged.

I will do further testing and if it does turn to be true and would definitely write a new compression algorithm. Man I probably already revealed too much!

I will keep you posted.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: