View Single Post
  #26  
Old 01-08-07, 00:46
robski robski is offline
Senior Member
 
Join Date: Dec 2005
Location: Kent UK
Posts: 3,739
Default

In the last Post we saw how unwanted detail (noise/grain effect) reduced the compression ratio. Unfortunately wanted fine detail has the same effect.

In 1948 Claude Shannon introduced a concept called Entropy which gives a fundamental mathematical limit on the best possible lossless data compression of any communication. This is all part of information theory, working out the shortest code to send a message. Measuring the information content in a piece of data. The key is to keep the essential information and discard the redundant data (code). Using a lossless compression scheme on fine detailed image data your be lucky if you manage to halve the file size (2:1 compression ratio). So according to Shannon's information theory some information has to be discarded if you want to reduce the file size further. ( or get a symbol to carry more information but thats another story) It was the JPEG committees job to find methods to discard information that the human eye and brain would not notice and if further information was discarded the brain could still recognize the image. The lossy compression scheme will continue to thrive all the time we have limited data storage and limits imposed on network bandwidth. The day we all have fibre optic cable to the doorstep, terabyte memory cards and petabyte hard disks the nasty JPEG baseline compressed images will be as useless as wax cylinder records. Remember JPEG was developed back in the days when the 56k modem was king.

Apart from the general interest in the topic the main aim is to help people limbo under various file size limits imposed by forums .

Some more experiments in Photoshop to illustrate that increased image detail (information) reduces the compression ratio.
I have used the same image size of 800 x 640 pixels which is typical of those posted in the Gallery. For each test I created a coloured checker board pattern with an increased number of squares. The Jpeg Quality setting was 12 ( max quality - minimum compression ). Note non of these images will have camera noise.

53,290 bytes 1 square
53,965 bytes 4 squares
62,548 bytes 16 squares
109,098 bytes 64 squares
209,375 bytes 256 squares
334,432 bytes 1024 squares
654,468 bytes 4096 squares but with a Quality Factor setting of 6 it just managed to get the file size (275,236 bytes) below the forums 300K limit

Somewhere between 256 and 1024 squares we had blown this forums 300K limit. To meet this limit extra compression is required with some loss in image quality.
In the case of 4096 squares ( each square ~ 12 x 10 pixels ) which is not especially detailed required a heavy compression setting of 6.

Assuming you have already taken some action to reduce the noise levels, what is the best course of action for images that have large areas which are highly detailed. For example shots showing the rough tree bark texture or fine grains of sand. Even shots showing lots of grass blades present a problem. Well to be honest you are going to struggle to get these under the 300K barrier. In a few cases you will fail to compress the image with sufficient quality to warrant posting.

Using a quality setting less than 5 will degrade the image so much that it will no longer show the fine detail you were trying to express. The next option is to reduce the image pixel count either by cropping or re-sampling. If you crop tighter try to exclude some of the detailed areas that are less important to the composition. If you downsize by re-sampling use the bilinear method which tries to preserve image detail. You may end up with a postage stamp sized image and still not worth posting. As far as baseline JPEG is concerned it's a no win situation. It might be worth exploring fractal based compression.

In general for the image to hit the optimum 200K with good quality it must have sizable areas with little or no detail. For example large expanses of blue sky or out of focus or plain backgrounds. Even if your border line with these types of shot you can often gain a bit of extra compression by lightly running the blur tool over these low detailed areas of the image.

Some readers are gluttons for punishment and keen for more detail on the Baseline JPEG compression method. I'll see if I can come up with a few more illustrations. In the meantime I am experimenting with a computer program written in C to further illustrate the Discrete Cosine Transform process.
__________________
Rob

-----------------------------------------------------
Solar powered Box Brownie Mk2

Captain Sunshine, to be such a man as he, and walk so pure between the earth and the sea.

WPF Gallery
Birdforum Gallery
http://www.robertstocker.co.uk updated

Last edited by robski; 01-08-07 at 00:54.
Reply With Quote