0

I wish to exploit redundancy among a set of similar colored JPG images. Set redundancy compression has been used successfully for similar 8-bit grayscale images. They basically find the MAX and MIN of a set of images and encode the original images as differences with respect to either the MAX or MIN image, depending on whichever is the smaller difference. About 20-50% additional compression has been obtained for grayscale images using this approach besides normal compression tools like gzip or bzip. I do the following:

  • Decompress the JPG images to RGB char buffers
  • Compute the MIN and MAX char buffers
  • Encode the difference char buffers as JPG images

The problem is that to retrieve the original image from the difference image, ideally I would need to encode the difference losslessly. But, there is no lossless transformation from RGB->JPG in libjpeg and even at quality=1.0, because the difference coefficients are small (1~10), I end up losing almost all the information (almost all decoded data is 1~3).

To solve this, I tried using huffman encoding of the difference char buffers.

  • Encode the difference char buffers using Huffman encoding

The original JPG images are of size ~256 KB, the corresponding RGB buffer is ~7.8 MB and the huffman encoded difference images are of size ~2.2 MB. So, Huffman encoding does save lot of space w.r.t RGB buffers but the original JPG equivalents are much smaller.

  • Any suggestions to store these difference buffers efficiently comparable in size to the 256 KB original JPG files ?
  • Is there a way to save these difference buffers with low valued data coefficients as JPG images without losing substantial information ?
user655617
  • 318
  • 3
  • 13
  • 1
    If your difference images are all very small values with lots of common color, why not try PNG compression? It makes use of horizontal and vertical symmetries and is good at exploiting long runs of constant color. An added benefit is that it's lossless :) – BitBank Apr 04 '13 at 01:43
  • Thanks for the info, I will try using libpng to store the difference char buffer. To be clear, the buffer looks like this : [link](http://pastebin.com/8wSE5HMK). Do you think this is a good candidate for png compression ? – user655617 Apr 04 '13 at 13:17
  • It's hard to guage any symmetries by looking at rows of numbers with no size information, but based on the repeating sequences it does look like a good candidate for PNG. – BitBank Apr 04 '13 at 14:14

0 Answers0