Quarter Life Crisis

The world according to Sven-S. Porst

« PossessionsMainLong standing wishes »

JPEG 2000

528 words

JPEG 2000 compressed As promised yesterday, here comes an comparison for traditional, Fourier transform based JPEG compression versus all new and exciting Wavelet transform based JPEG 2000 compression. I found it quite hard to come up with a decent comparison. To begin with, in this exciting age of digital cameras, I simply don't have high-quality photos. And photos taken in poor light conditions or with JPEG artifacts already in them may make bad material for a comparison. Thus I settled for a bit of a screen shot to do this as this was easy to achieve, it contains subtle details (X.3 style menu bar stripes), pre-existing artifacts (desktop backgrounds come JPEG compressed, high contrast lines (icons, icon labels) and the Dock's transparency.

JPEG compressed To actually see bad behaviour of the algorithms, I chose a high-ish compression rate and arranged for files to be of the same size. The image is 152x256 pixels in size. So raw data at 24 bit per pixel should be 116736 bytes. Using lossless PNG compression will reduce size to be 66498 bytes which is 56% of the original size. I arbitrarily decided that the respective JPEG compressions should be less than one tenth of the raw data's size, resulting in 9456 bytes for the JPEG 2000 file and 9614 bytes for the old-fashioned JPEG file – slightly more than 8% of the raw data size in both cases.

As you can see for yourself, JPEG 2000 gives better results at these settings. In particular it seems to give less visible artifacts (if you don't see them and have a flat panel, try looking at it from a steep angle) both in the menu bar and around the icons. It also does a better job at preserving colours (look at Zoidberg, the flag or the bit of sticky note).

So hooray for me – I managed to find an example where JPEG 2000 is actually better. I wasn't able to reproduce this for arbitrary images, photos in particular, though.

Further remarks and questions: Although the 'hard bit' of the compression should be faster for wavelets (DWT is O(n) while FFT is O(nlogn)), the traditional JPEG compression was much faster in GraphicConverter. Perhaps just lack of optimisation for the younger code. Or is there more pre-processing needed for JPEG 2000? While I've done the theory about Fourier and wavelet transforms, I never learnt how this is applied to colour images. Is the better preservation of colour due to the difference in compression or does JPEG 2000 specify a better way of storing colour information?

Finally, does JPEG 2000 also cut the image into chunks before doing the compression? [That's what I've always found most disappointing about JPEG – you have a method of doing something globally, yet the practical considerations make you cut things into tiny chunks first.] What kinds of wavelets are used? Can they be adjusted? Can I adjust the amount of detail information stored based on the location within the image?

Many interesting questions. Unfortunately the information I found on the net was too technical for me to enjoy, i.e. pure specifications or code, or too locked away to get my hands of it. Helpful pointers are appreciated.

December 6, 2003, 1:54

Add your comment

« PossessionsMainLong standing wishes »

Comments on

Photos

Categories

Me

This page

Out & About

pinboard Links

People

Ego-Linking