View Single Post
  #6  
Old August 19th 07, 12:53 AM posted to rec.photo.digital,uk.rec.photo.misc
Dave Cohen
external usenet poster
 
Posts: 841
Default Compression in JPEG files in digital cameras

ray wrote:
On Sat, 18 Aug 2007 11:55:45 -0700, aniramca wrote:

I need some help in explaining the JPEG compression feature in digital
cameras. My camera (which likely is similar to most others) has the
feature to compress the photo JPEG files in the storage card. It also
has the choice to have different pixel sizes (example: 3000x2250,
2000x1500, 1024x768, etc). What is the difference of the above two
features? If you store a 3000x2250 pixel data in compressed mode,
does it loose its quality? Can it be re-instated to full uncompressed
size without loosing photo quality?. When I compressed the data, it
will fit more pictures in a single storage card. But, is it the same
if I choose 2000x1500 pixel and no compression instead?
Thanks for info.


It will uncompress to the full resolution - however it will not be an
exact replica of the original image. JPEG is a 'lossy' compression
algorithm - meaning that some detail is lost in the act of compressing the
data. There are 'lossless' compression schemes as well, but the level of
compression with them is generally considerably less. From a practical
standpoint, you can do a lot of compression on a JPEG image before you see
noticeable loss of information. Before I got a camera capable of saving
RAW images, I always chose the highest resolution and the smallest amount
of compressin on JPEG images - now I simply save nearly everything in RAW
- even though it does take a lot of space. Memory cards are very cheap now
- IMHO it is better to get some extra cards and save everything using the
best method possible. I currently have 2-1gb cards and 1-2gb card for my
5mp camera - they run around $15 and $30 respectively.


The resolution refers to the amount of detail captured by the sensor and
saved before any compression (if any) is applied. Ultimately it will
translate into how large an image you can print. Initially, large prints
will lose resolution, continued enlargement will exhibit pixelation.
I always shoot at maximum resolution (5mp in my case). There will be
instances when lower resolutions are ultimately desired for web use or
email, but this can all be done later. This has little to do with how
the file is saved.

Jpeg compression reduces file size from whatever lossless format the
camera uses to a more manageable size. Usually, you are given a choice
of 3 settings with names like fine, super fine and normal. I can't for
the life of me ever see any difference between fine (the default) and
super fine except a very large size difference, so I use default and if
others disagree, as I'm sure they will, that's ok, but I don't want to
hear about it.
As mentioned elsewhere, the algorithm works by cleverly looking for
adjacent pixels of close color match and combining them. As you increase
the compression the quality goes down, but the appearance is quite
different from low resolution.
Fortunately you can easily see how this works. Save a file at least
compression, then use something like Irfanview to output a series of
files at decreasing quality (increasing compression). At some point you
will begin to notice the deterioration. Some software will actually show
you a preview of how the image will look at different degrees of
compression before you save.
I always save the original from the camera and avoid editing a modified
jpeg a second or more time.
Tiff and raw are lossless formats, but only some p&s's even offer that
option, presumably since the audience for a p&s isn't likely to want to
do the post processing involved, but there are exceptions.
Dave Cohen