A Photography forum. PhotoBanter.com

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PhotoBanter.com forum » Digital Photography » Digital Photography
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Compression quandary / question



 
 
Thread Tools Display Modes
  #1  
Old September 15th 06, 04:12 AM posted to rec.photo.digital
Earl Misanchuk
external usenet poster
 
Posts: 6
Default Compression quandary / question

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
  #2  
Old September 15th 06, 05:22 AM posted to rec.photo.digital
Steve Wolfe
external usenet poster
 
Posts: 109
Default Compression quandary / question


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


  #3  
Old September 15th 06, 05:49 AM posted to rec.photo.digital
Randy Berbaum
external usenet poster
 
Posts: 214
Default Compression quandary / question

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

  #4  
Old September 15th 06, 09:24 AM posted to rec.photo.digital
POHB
external usenet poster
 
Posts: 70
Default Compression quandary / question

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.

  #5  
Old September 15th 06, 07:52 PM posted to rec.photo.digital
Matt Ion
external usenet poster
 
Posts: 63
Default Compression quandary / question

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.
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compression question Ron Digital Photography 4 January 20th 05 09:55 PM
best compression for saving photos in jpeg? Brian Digital Photography 14 December 24th 04 01:59 PM
Digital Photography Tip #2: Avoid using too much in-camera compression Gary Hendricks Digital Photography 6 December 5th 04 01:45 AM
JPEG compression James Ramaley Digital Photography 14 October 26th 04 01:41 AM
Resolution or Compression? John Wright Digital Photography 18 September 8th 04 02:55 PM


All times are GMT +1. The time now is 10:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PhotoBanter.com.
The comments are property of their posters.