JPEG: Maximum Quality

PK
Posted By
Philip_Kaszerman
Nov 7, 2005
Views
1406
Replies
17
Status
Closed
I have been wondering if the maximum quality setting for JPEG really means zero compression loss. That would be great for myself and other hobbyists who are forced to use this file format when we bring pictures to an inexpensive photo kiosk. This could easily be the case based on my reading of the algorithm. The algorithm uses a “Fourier Transform” to convert an 8×8 pixel array per color into 64 frequencies; i.e. 64 variations in tone per color across the array. Since very few 8×8 pixel arrays will have that many “frequency components”, they come up as zeros which can then be discarded or get put into a pile with other zeros. One way or another, they no longer need a byte per pixel/per color.
Does anyone here have communication with PS programmers? I think the answer would be of interest to many people.

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

MD
Michael_D_Sullivan
Nov 7, 2005
I have been wondering if the maximum quality setting for JPEG really means zero compression loss.

Nope. For an example of how an image can suffer from a single recompression at maximum JPEG quality, I suggest you take a look at an experiment I did. The initial image is here <http://www.camsul.com/first.jpg> and the resaved version is here <http://www.camsul.com/second.jpg>. They look the same, which is what JPEG is all about. But they are not the same. I overlayed them to check the pixels that differed, using a threshold of 1 or 2. The pixels that differed by one or more RGB units are here <http://www.camsul.com/first-second-1.gif>, and the pixels that differed by two or more are here <http://www.camsul.com/first-second-1.gif>. And the degeneration continues at the next resave. Here is the second image resaved as a new image <http://www.camsul.com/third.jpg>. The changes from the second to third generation are less, but still noticeable: single-pixel or greater differences <http://www.camsul.com/second-third-1.gif>; two-pixel or greater differences <http://www.camsul.com/second-third-2.gif>.
JJ
John Joslin
Nov 7, 2005
There are dozens of postings in this forum on JPEG compression.

As far as I recall, the situation is that, since you decompress a JPEG file to open it, any change (even one pixel) will mean that, on saving it, there will be some degradation because even the highest quality setting involves compression. It is a "lossy" process.

I know this isn’t answering your question directly but it’s worth mentioning because many users wrongly think that max quality = no loss.

If "an inexpensive photo kiosk" will only accept JPEGs, you cannot expect laboratory quality prints anyway.
JJ
John Joslin
Nov 7, 2005
Sorry Michael, I got up and made a cup of tea before clicking POST MESSAGE — I could have saved myself the trouble. The tea is nice though 🙂
MD
Michael_D_Sullivan
Nov 7, 2005
John, as you now realize, not even on pixel needs to be changed. The mere fact of resaving as JPEG, even without modifications at high quality, causes changes to the RGB pixel values. This is a result of the fact that JPEG does not store pixel values, but stores regional aproximations. The bit-level changes are very minor at high quality levels, and most likely would not be noticed, but they are there.
PK
Philip_Kaszerman
Nov 8, 2005
Hi everybody,
Thanks for your responses. Those pictures of pixels tell the story. Still, it is too bad that PS does not have a zero loss setting. It seems that it would only require that PS only discard "frequencies" with zero amplitude. Then inverting those with non-zero amplitude would yield the original 8×8 pixel array. Then again, I have not dug into the JPEG specification itself.
JS
John_Slate
Nov 8, 2005
Yet resaved once or twice, and at the highest level, I would defy anyone to tell the difference in the actual print-out, compared to the before and after tiff counterparts brought through the same edits.

So if the integrity of your image at the pixel level is important to you, never save as Jpeg.

Ever.

However, if the disk space saving of Jpegs is key for you, AND if you don’t mind a small amount of degradation that can only be descerned by some type of overlay or apply image process to show the pixels that changed, then go ahead and resave a Jpeg.

On the otherhand you could also save Zip or LZW compressed tiffs, those compression schemes are lossless.

And if you fall into the camp of "really getting bent out of shape by things that you know to exist, but you cannot see", you should probably start saving everything in 16 bit if your scanner will give you a high-bit capture.

Don’t get me wrong.

I’m not advocating Jpegs, but geez they aren’t that bad.
JS
John_Slate
Nov 8, 2005
And if you fall into the camp of "really getting bent out of shape by things that you know to exist, but you cannot see"…

Kind of sounds like a religious thing.
JJ
John Joslin
Nov 8, 2005
And if you fall into the camp of "really getting bent out of shape by things that you know to exist, but you cannot see"

We certainly get one or two of those around these parts John!
C
chrisjbirchall
Nov 8, 2005
Ban the Task Manager!
DM
Don_McCahill
Nov 8, 2005
Still, it is too bad that PS does not have a zero loss setting

It is not PS that does this. It is the jpg compression algorithm. If you want zero loss, all you have to do is to save into a new format, like PSD or TIFF.

Then you can save away without degrading the image. Only at the final stage will you convert back to jpg. (And keep a good copy in the other format so you never have to make a copy of the jpg.)

Don
S
scb
Nov 9, 2005
If you want zero loss, all you have to do is to save into a new format, like PSD or TIFF. Then you can save away without degrading the image.

This brings up an interesting question: If a file is converted from JPEG to TIFF or PSD, and later converted back to JPEG, is there any additional loss?

scb
TD
Thee_DarkOverLord
Nov 9, 2005
yes, every time you save a jpeg no matter what the circumstances it removes data.
TD
Thee_DarkOverLord
Nov 9, 2005
is there an echo in here? 😉
L
LenHewitt
Nov 9, 2005
Yes, of course there is. Every time you save to JPG format some data loss occurs.
JH
Jeff_Holmes
Nov 9, 2005
Anyone know why jpeg2000 hasn’t been more prevalent? Is it just another extension to deal with and we already have enough file types?
MD
Michael_D_Sullivan
Nov 10, 2005
I think Jpeg2k uses some patented components, for which royalties must be paid, so it will not be incorporated willy-nilly into low-end products.
DM
Don_McCahill
Nov 10, 2005
But saving to a tiff or psd lets you save over and over without loss. You will lose again when you finally go to jpg, but only one set of losses is usually acceptable. The real problem is when you save over and over again in jpg.

Don

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

Related Discussion Topics

Nice and short text about related topics in discussion sections