Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Digital Photography > Compression quandary / question

Reply
Thread Tools

Compression quandary / question

 
 
Earl Misanchuk
Guest
Posts: n/a
 
      09-15-2006
I think I understand the basics of compression in JPGs, but I am
mystified by some observations. Specifically: Olympus E-300 with 14-53
lens, HQ setting at 1:4 compression, auto exposure. Three photos taken
at HQ setting, saved as JPGs without modification after uploading.

Examining EXIF info of those three shots in iView Pro, I find that one
of them was compressed at 1:5, one at 1:7, and one at 1:17 ( ! ). How
can that be? The contents of the photos were quite different, which I
expect would contribute to differences in overall file size after
compression, but shouldn't the compression ratio stay the same?

My understanding is that when I set the quality to HQ (1:4), that's what
the JPGs should be. Can anyone offer any explanation for what happened?

NOTE: I do know the virtues of saving files as RAW (and even TIFF), so
please don't give me a lecture on that point. I am simply trying to
puzzle out the strange observations.

ADVthanxANCE
 
Reply With Quote
 
 
 
 
Steve Wolfe
Guest
Posts: n/a
 
      09-15-2006

>I think I understand the basics of compression in JPGs, but I am
> mystified by some observations. Specifically: Olympus E-300 with 14-53
> lens, HQ setting at 1:4 compression, auto exposure. Three photos taken
> at HQ setting, saved as JPGs without modification after uploading.
>
> Examining EXIF info of those three shots in iView Pro, I find that one
> of them was compressed at 1:5, one at 1:7, and one at 1:17 ( ! ). How
> can that be?


When you set a JPG compression level, you do *not* specify an exact amount
(such as 1:4). Just how much compression you'll get still depends upon the
contents of the photo.

steve


 
Reply With Quote
 
 
 
 
Randy Berbaum
Guest
Posts: n/a
 
      09-15-2006
Earl Misanchuk <> wrote:
: I think I understand the basics of compression in JPGs, but I am
: mystified by some observations. Specifically: Olympus E-300 with 14-53
: lens, HQ setting at 1:4 compression, auto exposure. Three photos taken
: at HQ setting, saved as JPGs without modification after uploading.

: Examining EXIF info of those three shots in iView Pro, I find that one
: of them was compressed at 1:5, one at 1:7, and one at 1:17 ( ! ). How
: can that be? The contents of the photos were quite different, which I
: expect would contribute to differences in overall file size after
: compression, but shouldn't the compression ratio stay the same?

: My understanding is that when I set the quality to HQ (1:4), that's what
: the JPGs should be. Can anyone offer any explanation for what happened?

: NOTE: I do know the virtues of saving files as RAW (and even TIFF), so
: please don't give me a lecture on that point. I am simply trying to
: puzzle out the strange observations.

What you may not have understood is that Jpeg compression is variable. It
is not a hard and fast ratio. Any image with large areas of the same color
compress smaller than the same size area with lots of detail. So if you
take a photo at night that is mostly dark with a small lit subject in the
middle would compress very small (all that black compresses to only a few
digits). But a daytime image with lots of details and small patches of
color needs lots more data to describe.

Here's an example of how this works. If you have an image that is 16
pixels in a 4x4 grid and the entire image is a single color that can be
called "1", the entire image could be compressed by calling it "1x16"
(color one repeted 16 times). While the same image space with 16 different
colors would take more room,
"1x1,2x1,3x1,4x1,5x1,6x1,7x1,8x1,9x1,10x1,11x1,12x 1,13x1,14x1,15x1,16x1".
As you can see the compression will vary greatly with the subject. And
this is before the jpeg process gets into its "lossy" formula. BTW this is
just an example of how discrepancys in compression can happen, not an
exact description of how the jpeg format works.

So your example that several images of different subjects were stored at
different compression ratios is perfectly normal for Jpeg. Even "lossless"
compression formulas will compress different subjects differently. If you
want a set file size your only real choice is Raw as this format stores
the data from each pixel individually with no regard to what values are in
pixels on either side. So the file size will be very stable. Of course
this file will be huge as there is no (or nearly no) compression at all.
(the prior statement is general as some manufacturers flavor of raw can
work different than others and so may be variable in their application.)

Randy

==========
Randy Berbaum
Champaign, IL

 
Reply With Quote
 
POHB
Guest
Posts: n/a
 
      09-15-2006
Randy Berbaum wrote:
>
> If you
> want a set file size your only real choice is Raw as this format stores
> the data from each pixel individually with no regard to what values are in
> pixels on either side. So the file size will be very stable. Of course
> this file will be huge as there is no (or nearly no) compression at all.
> (the prior statement is general as some manufacturers flavor of raw can
> work different than others and so may be variable in their application.)


Some manufacturer's RAW formats use lossless compression, others do not
compress. With lossless compression your example of a group of
identical pixels still applies so the RAW files could vary widely in
size.

 
Reply With Quote
 
Matt Ion
Guest
Posts: n/a
 
      09-15-2006
Randy Berbaum wrote:

> What you may not have understood is that Jpeg compression is variable. It
> is not a hard and fast ratio. Any image with large areas of the same color
> compress smaller than the same size area with lots of detail. So if you
> take a photo at night that is mostly dark with a small lit subject in the
> middle would compress very small (all that black compresses to only a few
> digits). But a daytime image with lots of details and small patches of
> color needs lots more data to describe.
>
> Here's an example of how this works. If you have an image that is 16
> pixels in a 4x4 grid and the entire image is a single color that can be
> called "1", the entire image could be compressed by calling it "1x16"
> (color one repeted 16 times). While the same image space with 16 different
> colors would take more room,
> "1x1,2x1,3x1,4x1,5x1,6x1,7x1,8x1,9x1,10x1,11x1,12x 1,13x1,14x1,15x1,16x1".
> As you can see the compression will vary greatly with the subject. And
> this is before the jpeg process gets into its "lossy" formula. BTW this is
> just an example of how discrepancys in compression can happen, not an
> exact description of how the jpeg format works.


That's a pretty fair description.

Working in the "lossy" component then, you get something like this:

Say you have a section of sky, for the sake of argument, a strip one pixel wide
and 8 pixels long. Each pixel is a slightly different shade of blue - say for
easy example it goes in a steady gradient from from shade "1" to shade "8".

Now normal lossless compression would probably not reduce this at all, because
each pixel is a different value. But set for the highest-quality,
lowest-compression level of lossy compression, and what you might get is the
software deciding that the difference is small enough that if pixels 1 and 2
were the same shade, it wouldn't be noticeable... same with 3 and 4, and so
on... so instead of a strip of color of shades
"1x1,2x1,3x1,4x1,5x1,6x1,7x1,8x1,", the software would discard every second
pixel, and describe it as "1x2,3x2,5x2,7x2,9x2". Those intermediate pixels are
now gone, so when the image is displayed, it creates essentially a rougher,
"stepped" gradient. This is why it's called "lossy" compression.

As you reduce the quailty level and increase the compression, you get smaller
files, but less accurate color... for example, the next step might start with
the "2" pixel and discard one pixel to either side... so you'd get
"2x3,5x3,8"... or it may take the first pixel and discard the next two, for
"1x3,4x3,7x2". That decision would be made by the software depending on the
exact content and the specific algorithm used.

Obviously this is a VERY simplistic description, but it gives a bit of an idea
of how "lossy" compression works. BTW, MP3 compression uses a similar concept
on audio files, determining what parts of sound wouldn't normally be noticeable
(say, a wrist watch ticking on a drummer's wrist while he's playing!), and
simply discarding that data.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
in a bit of a quandary about an SMTP receiver Eric S. Johansson Python 0 07-15-2007 03:38 PM
Laptop Quandary Cheekycharlie Computer Support 4 07-05-2007 05:15 AM
XP image compression question MountainCat Computer Support 2 01-10-2004 11:32 PM
The Submit quandary Robyn Javascript 0 09-08-2003 09:38 AM
JPEG Compression (Newbie Question) Nicholas J. Coscoros Digital Photography 5 07-30-2003 07:20 PM



Advertisments