BetterPhoto Q&A
Category: New Questions

Photography Question 

Donna R. Moratelli
 

untitled


How can I downsize a jpg without loosing image quality. My images never look sharp.


To love this question, log in above
December 30, 2001

 

Ken Pang
  How do you make a 1 litre jug smaller, without losing any of it's capacity?

Sorry if that answer's a little "smart alec", but that's the reality of it. There are two kinds of compression in computing, they are loosely defined as "lossy" and "lossless".

Lossy compression relies on the fact that the eye will not notice anything amiss, if colour or shape is slightly off. So the most common types is to either compress the colour palette, or "block up" the shapes.

In the first case, the photograph is analysed for the number of distinct colours. If out of a palatte of 16.7 Million colours (24 bits per pixel), less than 65,536 colours are used, then they can map the colours to a 16 bpp scheme. Notice here that there is so far no loss of quality - only the binary representation has changed.

On the other hand, if there are say, 100,000 colours used (too many for 16 bit, too few for 24 bit) then they can estimate, that two colours are close enough to be represented by the same colour. That's lossy compression. You've lost some of the quality of the photo.

The other method is used by jpeg - it grabs 8 x 8 pixel blocks and inspects the colours for likeness. If they are alike, then it considers all that block of the same colour. In most photographs, you would not notice this. However, in certain cases you will - like when you are expecting sharpness, when you have photographs with gradients (such as sunsets) or when there are lots of small curves in your photo (Since blocks with make your curve a little jagged). Most of all, you will notice for small photographs, because the 8 x 8 pixel block is unchangeable.

Personally, I wouldn't go near jpeg with a ten foot barge pole, unless I had to transmit a photograph and quality was of little concern.

Lossless compression is based on standard computer data compression. It relies on the fact that some byte patterns occur frequently in data. For example, if I knew that the string "alphabet" occured frequently in my file, I could instruct the compressor replace "alphabet" with "abc" and instruct the decompressor to replace "abc" with "alphabet" (well, actually, it's realistically a lot more complex than that, but that's a layman's explaination) I am then saving 5 bytes for ever occurance of alphabet.

As you can infer, the data that goes into the compressor is identical to the data that comes out of the decompressor, so the compression method is called "lossless". No detail is lost. This compression type is used in TIFF files with LZW compression turned on, or by running winzip or similar program over any file.

So, how does all that translate to real life? Well, basically, if you size down the file, you lose quality. The only way you can avoid that is in some instances, you can shift your photo from 24 bit colour to 16 bit colour with no perceivable loss in quality.

The other option is to use data compression if you're intending to store, rather than post on a website or send.


To love this comment, log in above
January 06, 2002

 

Donna R. Moratelli
  Thank you Ken, that answered two questions.


To love this comment, log in above
January 06, 2002

 

doug Nelson
  Any digital operation that throws out pixels or even reshuffles them, causes the image to need sharpening. The sharpening function in your imaging software has to allow degrees of sharpening, not a meataxe all-or-nothing approach. In Photoshop or Photoshop LE it's called, illogically, Unsharp Mask. For a compressed JPEG, try settings of about 70/.7/3 (the three settings Unsharp Mask provides, in order), and work from there.

When an image has been stripped to its essential color and structural elements in JPEG, sharpening has to be pretty judiciously done. A halo effect around objects, making people look like saints in a Renaissance painting, is a clue that you're overdoing it.

It's also possible to compress an image too much in JPEG mode and ruin it's integrity. I agree with Ken that it's a necessary evil. For images you care about and want to archive to CD, JPEG compression is like trying to make sushi with a chain saw.

Use JPEG only as your LAST step in preparing an image for the web. Work it and get it the way you want it as a TIF, archive it as a TIF, and THEN JPEG it, compressing it only as much as the use demands.

We're going to get this question, so I'll answer it now: Suppose my camera shoots in JPEG mode, and it's all I use, and my images look fine?

You'll get away with some editing and saving, especially if you work the image before you compress it. It's safer to convert the raw JPEG image to a TIF while you're working it, then use JPEG only to compress it for the web.


To love this comment, log in above
January 07, 2002

 
This old forum is now archived. Use improved Forum here

Report this Thread