I 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.