Go Back   Steve's Digicams Forums > Digicam Help > General Discussion

Reply
 
Thread Tools Search this Thread
Old Feb 1, 2006, 12:17 PM   #1
Junior Member
 
Join Date: Feb 2006
Posts: 2
Default

I am a total newcomer to digital photograpy but I understand that jepg files will lose informationas they are manipulated in any way, even by simply opening and closing a file. Is there any way to avoid such degradation, aside from working only with copies of a file? Are Photoshop files also subject to such data losses?
andyrode is offline   Reply With Quote
Sponsored Links
Old Feb 1, 2006, 12:37 PM   #2
E.T
Senior Member
 
E.T's Avatar
 
Join Date: Jul 2003
Posts: 921
Default

Now opening file for viewing it and closing it doesn't cause degrading, only recempressing it. (which is done when you press save button)

PhotoShop's file format like that of Paint Shop Pro's are lossless so it's better to use those or TIFF for intermediate stages of post processing and save image as JPEG not until you've done editing.
E.T is offline   Reply With Quote
Old Feb 1, 2006, 12:54 PM   #3
Administrator
 
Join Date: Jun 2003
Location: Savannah, GA (USA)
Posts: 22,378
Default

andyrode wrote:
Quote:
I am a total newcomer to digital photograpy but I understand that jepg files will lose informationas they are manipulated in any way, even by simply opening and closing a file.
If you mean by opening and saving a file, Yes (if it's JPEG). The editor is going to recompress it when you do that (and if you have JPEG quality set lower in the editor, it can degrade it). If you open it and close it without saving, No (it won't degrade it).

Here is an article you may want to read written by Mike Chaney:

JPEG Images: Counting Your Losses



JimC is offline   Reply With Quote
Old Apr 4, 2006, 2:19 AM   #4
Junior Member
 
Join Date: Nov 2004
Posts: 4
Default

what if you open a jpeg image then save it without manipuating anything and you save it to the maximum setting, is the image quality degraded? i noticed that the resulting file have a larger size than the original. does this mean that the image improved because of the increase in filesize?

thanks.

booghaw is offline   Reply With Quote
Old Apr 4, 2006, 2:37 AM   #5
E.T
Senior Member
 
E.T's Avatar
 
Join Date: Jul 2003
Posts: 921
Default

After something has been stripped away by too hard compression there's no way to get that back, it just means that what's left isn't compressed so hard.
E.T is offline   Reply With Quote
Old Apr 4, 2006, 8:50 AM   #6
Senior Member
 
BillDrew's Avatar
 
Join Date: Jun 2002
Location: Hay River Township, WI
Posts: 2,512
Default

booghaw wrote:
Quote:
what if you open a jpeg image then save it without manipuating anything and you save it to the maximum setting, is the image quality degraded?...
Yes, but so slightly that you will have a very hard time finding the changes.

booghaw wrote:
Quote:
... does this mean that the image improved because of the increase in filesize?
No, it means there is less further degredation than you would have had with a smaller file size.

Do some experiments. Open an image with lots of detail and high contrast edges. Then "save as"at various amounts of JPEG compression with names like comp120.jpg, comp110.jpg, ... - the numbers matching whatever your program uses to specify the amount of JPEG compression. I think you will find that there is little noticable degredation until you reach about three quartersof the compression range. And tollerable degredation further down.
BillDrew is offline   Reply With Quote
Old Apr 4, 2006, 9:32 AM   #7
Senior Member
 
Join Date: Sep 2005
Posts: 1,093
Default

You've received a lot of good responses so far. Let me just add a couple of points to the discussion:

1. "Quality" or "compression factor" is an abomination that has been addd ad hoc to JPEG (it is not part of the standard at all). What these things invariably do is something along these lines: JPEG includes what are called "quantization tables." These tables are, at heart, bandpass filters that are applied to the 8x8 pixel units called "blocks" in JPEG. The purpose of the quant tables is to increase the number of 0s in the frequency-domain representation of the data. The Huffmann coding (a kind of run-length encoding) that is done on the quantized frequency data is where the actual compression comes from, and itdoes a better job if there are longer runs of the same number, and the easiest "same number" to get in an image is 0.

So what? Well, a well-designed quantization table has a rolloff that is designed topreferentially throw away data that you won't miss. When you apply a "quality factor," you just change each element in the quant table by a constant value -- that is, you screw up the frequency tuning of the original design. Quality factors were added by hacks to easily lower the size of the file without paying any attention to the effect on the image. If quality factor had been designed by people who could buy a vowel, they would represent completely different quant tables tuned for different rolloffs. The upshot is that you should NEVER use anything other than 100% quality factor or minimum compression, which is a value that will use the quant table as it was designed to be used.

2. Resaving a changed JPEG file usually causes generational loss, but this is a tricky business. For example, if you change the exif data in a jpeg file, many applications will not recompress the JPEG data -- the exif data is stored separately from the JPEG image in those file formats that support exif (there is no such thing as a JPEG file format -- the standard defines JPEG data streams. Many file formats have been defined that will allow you to save JPEG streams and then read them back into memory, but all are outsde the JPEG standard. The most common file format on a PC is JFIF, which also supports exif data and can be resaved without recompressing the JPEG data part if the prgrammer who implemented the save is not a fool -- BIG if).

If you do resave a JPEG image, the generational loss will vary widely from one prgram to another.One reason for this is that the quant tables need not be the same from one JPEG implementation to the next. If you happen to be using a file save utility that employs a different quant table than the original file saving program used, you'll take a much bigger hit than if you were using the same quant table twice in a row. Another, related hit is that many file saving programs apply "quality factors" willy-nilly. If you run into a program that tries to compress at alower "quality factor" than you had used, you will again take a big hit in generational loss. Of course, if you image processed the image or changed its size, you will incur another round of generational loss. Barring those issues, you will just slowly lose quality only due to integer round-off, which will degrade the image quality very slowly indeed. But, if you aren't image processing or changing image size, there is really no need to resave the image anyway.




tclune is offline   Reply With Quote
 
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off



All times are GMT -5. The time now is 4:45 AM.