JPEG Questions: Loss In Quality When "Saving"

X
Posted By
xtx99
Apr 8, 2004
Views
708
Replies
28
Status
Closed
I’m confused about quality deterioration when repeatedly opening and "saving" JPEG images. I’ve read that every time a JPEG image is "saved," some quality is lost due to the lossy compression format.
My questions are….

1) What is meant by "saving" a JPEG image?

2) If I simply "open" a JPEG image in Microsoft Photo Editor, Adobe Photoshop CS or any other image editor, View the JPEG image and then simply exit out of viewing the JPEG, am I actually "saving" it again and therefore loosing quality?

3) If in Windows I right click on a JPEG and make a duplicate copy of the JPEG, is the copy (with a different name) "saved" and therefore the quality of the copy diminished.

4) If I open a JPEG in a photo editor and "save as" (instead of simply exiting) and use the same name as the JPEG I just opened, is the quality diminished?

When I do all of the above things, I don’t notice any decrease in quality and the JPEG seems to be exactly the same size so I’m guessing I haven’t degraded the original. If I’m wrong, I’m guessing I should make each JPEG file "read only" or burn them to a CD or DVD so they can’t be changed when I view them.

If I open up a JPEG in a photo editing program and make any changes to the JPEG at all, I can understand that the quality degrades. Any advice on my questions are appreciated.

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

JC
James Connell
Apr 8, 2004
Xtx99 wrote:
I’m confused about quality deterioration when repeatedly opening and "saving" JPEG images. I’ve read that every time a JPEG image is "saved," some quality is lost due to the lossy compression format.
My questions are….

1) What is meant by "saving" a JPEG image?

JPEGs are decompressed from a file to a bitmap in memory – saving amounts to recompressing it back into a file.

2) If I simply "open" a JPEG image in Microsoft Photo Editor, Adobe Photoshop CS or any other image editor, View the JPEG image and then simply exit out of viewing the JPEG, am I actually "saving" it again and therefore loosing quality?

No

3) If in Windows I right click on a JPEG and make a duplicate copy of the JPEG, is the copy (with a different name) "saved" and therefore the quality of the copy diminished.

No, that just copies the file byte per byte.

4) If I open a JPEG in a photo editor and "save as" (instead of simply exiting) and use the same name as the JPEG I just opened, is the quality diminished?

Maybe, see #1. But as long as you made no changes there may or may not be degradation.

When I do all of the above things, I don’t notice any decrease in quality and the JPEG seems to be exactly the same size so I’m guessing I haven’t degraded the original. If I’m wrong, I’m guessing I should make each JPEG file "read only" or burn them to a CD or DVD so they can’t be changed when I view them.

If I open up a JPEG in a photo editing program and make any changes to the JPEG at all, I can understand that the quality degrades. Any advice on my questions are appreciated.
J
John
Apr 8, 2004
James has answered all your questions, and hopefully put your mind at ease. I will just add that you ahould use File>Save for Web when you save JPEG files. This way you can experiment with quality levels and file sizes and see for yourself, before you save a file, whether you will be satisfied with the results at various quality and compression levels.

John
DH
Darrel Hoffman
Apr 8, 2004
1) What is meant by "saving" a JPEG image?

Exactly that. Opening it in any program that can edit it (and therefore must decompress to work on it) and then saving it back in JPEG format (causing a recompress.)

2) If I simply "open" a JPEG image in Microsoft Photo Editor, Adobe
Photoshop
CS or any other image editor, View the JPEG image and then simply exit
out of
viewing the JPEG, am I actually "saving" it again and therefore
loosing
quality?

No.

3) If in Windows I right click on a JPEG and make a duplicate copy of
the
JPEG, is the copy (with a different name) "saved" and therefore the
quality of
the copy diminished.

No.

4) If I open a JPEG in a photo editor and "save as" (instead of
simply
exiting) and use the same name as the JPEG I just opened, is the
quality
diminished?

Yes.

When I do all of the above things, I don’t notice any decrease
in
quality and the JPEG seems to be exactly the same size so I’m guessing
I
haven’t degraded the original.

Try doing it to the same image 50 times. It will show.

If I’m wrong, I’m guessing I should make each
JPEG file "read only" or burn them to a CD or DVD so they can’t be
changed when
I view them.

That’s one way to do it. The other is to simply not save over your jpg files. If you’re doing any edits, save them in an uncompressed format like bmp or tif, and don’t convert back to jpg until you’re absolutely finished. (Even then, you might want to keep uncompressed copies in case you have to make more changes later.)

If I open up a JPEG in a photo editing program and make any
changes to
the JPEG at all, I can understand that the quality degrades.

It doesn’t matter if you change it or not. If you open it up and then re-save it, you are causing a decompress and recompress of the file, which will result in quality degradation. Obviously, the level of compression will determine just how much. If you save at Maximum quality, you will not lose nearly as much quality as you would in lower settings. Any compression setting will still lose SOME quality, however, especially if you re-save multiple times, so this is why you want to leave images uncompressed until they’re completely final.
S
Stephan
Apr 8, 2004
"Darrel Hoffman" wrote in message

It doesn’t matter if you change it or not. If you open it up and then re-save it, you are causing a decompress and recompress of the file, which will result in quality degradation. Obviously, the level of compression will determine just how much. If you save at Maximum quality, you will not lose nearly as much quality as you would in lower settings. Any compression setting will still lose SOME quality, however, especially if you re-save multiple times, so this is why you want to leave images uncompressed until they’re completely final.
Sorry but this is wrong.
Opening and restoring a JPEG will NOT cause any degradation at all. You lose data if you change something to your file and recompress it or, of course, if you don’t change anything to it but recompress it at a lower setting.
Try it and see by yourself: open and close a JPEG as many times as you want and try to find any sign of data loss.

Stephan
A
al-Farrob
Apr 8, 2004
Stephan wrote:

Sorry, you did not understand what Darrel wrote, he wrote: "if you re-save it" whch is right, whether you change it or not

"Darrel Hoffman" wrote in message

It doesn’t matter if you change it or not. If you open it up and then re-save it, you are causing a decompress and recompress of the file, which will result in quality degradation. Obviously, the level of compression will determine just how much. If you save at Maximum quality, you will not lose nearly as much quality as you would in lower settings. Any compression setting will still lose SOME quality, however, especially if you re-save multiple times, so this is why you want to leave images uncompressed until they’re completely final.
Sorry but this is wrong.
Opening and restoring a JPEG will NOT cause any degradation at all. You lose data if you change something to your file and recompress it or, of course, if you don’t change anything to it but recompress it at a lower setting.
Try it and see by yourself: open and close a JPEG as many times as you want and try to find any sign of data loss.

Stephan


al-Farrob

"16 photographs by al-Farrob"
http://www.al-farrob.com
DH
Darrel Hoffman
Apr 8, 2004
Sorry, you did not understand what Darrel wrote, he wrote: "if you
re-save
it" whch is right, whether you change it or not

Yeah, what he said. If you open and SAVE a jpg, whether or not you make any changes, you will losw quality. Saving a file is different from just closing a file.
JC
James Connell
Apr 8, 2004
Darrel Hoffman wrote:
Sorry, you did not understand what Darrel wrote, he wrote: "if you

re-save

it" whch is right, whether you change it or not

Yeah, what he said. If you open and SAVE a jpg, whether or not you make any changes, you will losw quality. Saving a file is different from just closing a file.

if the same settings are used to recompress a decompressed Jpeg – it doesn’t loose any data. try it – open a pix and then resave it, the file sizes match. at least the code in the jpeg consortiums comp/decomp routines do ( as far as i’v gotten into them ). it’s because the decomp just reverses the comp alogrithim and since all the data fits the huff table, it doesn’t throw any out. this wouldn’t hold true if the compressor wasn’t the same as the decomp.

it’s kinda like a 3D jigsaw puzzle that fits in a box all the pieces get trimed to fit the box and will fit back together in the box as long as no piece gets changed and the same person repacks the box! a diierent pakager will not put it back together the same way and will ‘trim’ a piece or two to fit.
A
al-Farrob
Apr 8, 2004
James Connell wrote:

Darrel Hoffman wrote:
Sorry, you did not understand what Darrel wrote, he wrote: "if you

re-save

it" whch is right, whether you change it or not

Yeah, what he said. If you open and SAVE a jpg, whether or not you make any changes, you will losw quality. Saving a file is different from just closing a file.

if the same settings are used to recompress a decompressed Jpeg – it doesn’t loose any data. try it – open a pix and then resave it, the file sizes match. at least the code in the jpeg consortiums comp/decomp routines do ( as far as i’v gotten into them ). it’s because the decomp just reverses the comp alogrithim and since all the data fits the huff table, it doesn’t throw any out. this wouldn’t hold true if the compressor wasn’t the same as the decomp.

it’s kinda like a 3D jigsaw puzzle that fits in a box all the pieces get trimed to fit the box and will fit back together in the box as long as no piece gets changed and the same person repacks the box! a diierent pakager will not put it back together the same way and will ‘trim’ a piece or two to fit.

I have no reason, nor knowledge to doubt, but is this the way ps implements the algorithm or is it general?
The OP has posted the question to several ngs (not cross-posting), isn’t it true that other programs behave otherwise?


al-Farrob

"16 photographs by al-Farrob"
http://www.al-farrob.com
S
Stephan
Apr 9, 2004
"Darrel Hoffman" wrote in message
Sorry, you did not understand what Darrel wrote, he wrote: "if you
re-save
it" whch is right, whether you change it or not

Yeah, what he said. If you open and SAVE a jpg, whether or not you make any changes, you will losw quality. Saving a file is different from just closing a file.

Have you tried it or do you just repeat what you’ve read? Do yourself a favor and try by yourself.
Please post any results proving me wrong, seeing is believing.

Stephan
S
Stephan
Apr 9, 2004
"al-Farrob" wrote in message
Stephan wrote:

Sorry, you did not understand what Darrel wrote, he wrote: "if you re-save it" whch is right, whether you change it or not

No difference.
Saving without changes is the same as just closing.
Try it!

Stephan
T
Tabasco1
Apr 9, 2004
No difference.
Saving without changes is the same as just closing.
Try it!

Stephan

I did I created a 100 by 100 image of a gradient fill. Then I saved named original.jpg. at that point it was 9,673 bytes.

Then I saved it as original not.jpg and proceeded to open it and save it and repeat 6 times. With out making any changes. At that point the new file, Original not’s size was 9,688 bytes.

I used the same compression ratio every time, 4. While the difference was small the file is small also.

Was the visual difference noticeable? Barely but yes.

Charles
Torrance, California
www.mamahudsbakery.com
S
Stephan
Apr 9, 2004
"Tabasco1" wrote in message

I did I created a 100 by 100 image of a gradient fill. Then I saved named original.jpg. at that point it was 9,673 bytes.

Then I saved it as original not.jpg and proceeded to open it and save it
and
repeat 6 times. With out making any changes. At that point the new file, Original not’s size was 9,688 bytes.

I used the same compression ratio every time, 4. While the difference was small the file is small also.

Was the visual difference noticeable? Barely but yes.

Interesting, Can you show it?

Stephan
DH
Darrel Hoffman
Apr 12, 2004
I did I created a 100 by 100 image of a gradient fill. Then I saved
named
original.jpg. at that point it was 9,673 bytes.

Then I saved it as original not.jpg and proceeded to open it and
save it
and
repeat 6 times. With out making any changes. At that point the new
file,
Original not’s size was 9,688 bytes.

I used the same compression ratio every time, 4. While the
difference was
small the file is small also.

Was the visual difference noticeable? Barely but yes.

Interesting, Can you show it?

I just did the same test with my own image, and yes, the difference is very noticeable. (Probably more noticable in some images than others, but my sample, a black-on-white line drawing, showed very obvious image degradation after just 3 re-saves.) I’d be happy to show you, but this is a non-binary group. Where do people generally post pictures in relation to this group?

(And why isn’t there an alt.binaries.photoshop or equivalent? Seems like there’s obvious justifiable cause for such a group…)
DH
Darrel Hoffman
Apr 12, 2004
Interesting, Can you show it?

I’ve posted an example in alt.binaries.comp-graphics. Look for thread titled "Results of JPG compression".
V
Voivod
Apr 12, 2004
On Mon, 12 Apr 2004 16:48:35 -0400, "Darrel Hoffman" scribbled:

Interesting, Can you show it?

I’ve posted an example in alt.binaries.comp-graphics. Look for thread titled "Results of JPG compression".

Just as an FYI:
news:alt.binaries.comp-graphics

Will take most complaint news readers right there.
S
Stephan
Apr 12, 2004
"Darrel Hoffman" wrote in message
Interesting, Can you show it?

I’ve posted an example in alt.binaries.comp-graphics. Look for thread titled "Results of JPG compression".
I tried on Google groups:
Your search – Results of JPG compression group:alt.binaries.comp-graphics – did not match any messages posted between Mar 12, 2004 and today. Where is it?

Stephan
V
Voivod
Apr 13, 2004
On Mon, 12 Apr 2004 23:29:43 GMT, "Stephan"
scribbled:

"Darrel Hoffman" wrote in message
Interesting, Can you show it?

I’ve posted an example in alt.binaries.comp-graphics. Look for thread titled "Results of JPG compression".
I tried on Google groups:
Your search – Results of JPG compression group:alt.binaries.comp-graphics – did not match any messages posted between Mar 12, 2004 and today. Where is it?

Google doesn’t carry the binary groups.
S
Stephan
Apr 13, 2004
"Voivod" wrote in message
On Mon, 12 Apr 2004 23:29:43 GMT, "Stephan"
scribbled:

"Darrel Hoffman" wrote in message
Interesting, Can you show it?

I’ve posted an example in alt.binaries.comp-graphics. Look for thread titled "Results of JPG compression".
I tried on Google groups:
Your search – Results of JPG compression
group:alt.binaries.comp-graphics –
did not match any messages posted between Mar 12, 2004 and today. Where is it?

Google doesn’t carry the binary groups.

OK, makes sense: I can’t see it then because my ISP can’t find the group either

Stephan
DH
Darrel Hoffman
Apr 13, 2004
OK, makes sense: I can’t see it then because my ISP can’t find the
group
either

Well, anyways, it’s not hard to reproduce the results yourself. Take any image, (I used a black-on-white line drawing), and save as JPG, quality 4*. Now open it, and save it again under a new name, same settings. Open the new file, and re-save it. (Use "Save as…" and save on the same file name. Just doing a Ctrl-S won’t do anything, because Photoshop knows you haven’t changed anything, so it won’t actually save.) Repeat this step 4 or 5 times. Now open your original saved JPG and compare it to the one you’ve saved repeatedly. I guarantee you will notice a difference.

*(You’ll lose quality over time even with maximum quality, but it’s much more obvious with a lower setting. If you use the highest quality it may take 15-20 iterations for the compression artifacts to be noticeable.)
DH
Darrel Hoffman
Apr 13, 2004
I’ve posted an example in *alt.binaries.comp-graphics*. Look for
thread
titled "Results of JPG compression".

Just as an FYI:
news:alt.binaries.comp-graphics

Will take most complaint news readers right there.

Is there a reason you just told me what I obviously just figured out on my own?

And while I do have many complaints about Outlook, I assume you meant "compliant"?

;-p
V
Voivod
Apr 13, 2004
On Tue, 13 Apr 2004 09:40:09 -0400, "Darrel Hoffman" scribbled:

I’ve posted an example in *alt.binaries.comp-graphics*. Look for
thread
titled "Results of JPG compression".

Just as an FYI:
news:alt.binaries.comp-graphics

Will take most complaint news readers right there.

Is there a reason you just told me what I obviously just figured out on my own?

How is it obvious you figured it out on your own? If you figured it out on your own why didn’t you include the news: link in the first place?

And while I do have many complaints about Outlook, I assume you meant "compliant"?

Ah yes. lame the typo.
DH
Darrel Hoffman
Apr 13, 2004
I’ve posted an example in *alt.binaries.comp-graphics*. Look for
thread
titled "Results of JPG compression".

Just as an FYI:
news:alt.binaries.comp-graphics

Will take most complaint news readers right there.

Is there a reason you just told me what I obviously just figured out
on
my own?

How is it obvious you figured it out on your own? If you figured it out on your own why didn’t you include the news: link in the first place?

Note asterisks in previous quote… You told me to post it to a group after I just said I’d posted to that exact group.
V
Voivod
Apr 13, 2004
On Tue, 13 Apr 2004 14:08:26 -0400, "Darrel Hoffman" scribbled:

I’ve posted an example in *alt.binaries.comp-graphics*. Look for
thread
titled "Results of JPG compression".

Just as an FYI:
news:alt.binaries.comp-graphics

Will take most complaint news readers right there.

Is there a reason you just told me what I obviously just figured out
on
my own?

How is it obvious you figured it out on your own? If you figured it out on your own why didn’t you include the news: link in the first place?

Note asterisks in previous quote… You told me to post it to a group after I just said I’d posted to that exact group.

No…. I told you how to make a LINK to that newsgroup by adding news: in front of the group’s name. Do try reading things before replying. Here, I’ll quote it again for you:

Just as an FYI:
news:alt.binaries.comp-graphics
[Note NEWS: listed before the group name.]
Will take most compliant news readers right there.

I’ll even fix my spelling so you don’t have that to whine about.
J
Joe
Apr 14, 2004
"Darrel Hoffman" wrote:

OK, makes sense: I can’t see it then because my ISP can’t find the
group
either

Well, anyways, it’s not hard to reproduce the results yourself. Take any image, (I used a black-on-white line drawing), and save as JPG, quality 4*. Now open it, and save it again under a new name, same settings. Open the new file, and re-save it. (Use "Save as…" and save on the same file name. Just doing a Ctrl-S won’t do anything, because Photoshop knows you haven’t changed anything, so it won’t actually save.) Repeat this step 4 or 5 times. Now open your original saved JPG and compare it to the one you’ve saved repeatedly. I guarantee you will notice a difference.

*(You’ll lose quality over time even with maximum quality, but it’s much more obvious with a lower setting. If you use the highest quality it may take 15-20 iterations for the compression artifacts to be noticeable.)

I don’t know why you have to waste your time to do that kind of test, and why you need a test to know it will show some difference.

Since Photoshop has 12 as MAX quality or 100% so "4" is 1/3 or about 33.33% of the original. So you only need to save ONCE at 33% to see the difference, and you don’t even need to save once to know 33.33% won’t be as good as 100%

Or you save the 2nd time as 100% of 33.33% you will only get 100% of 33.33% *not* 100% of the original, so your test won’t make any sence.
DH
Darrel Hoffman
Apr 14, 2004
I don’t know why you have to waste your time to do that kind of test,
and
why you need a test to know it will show some difference.
Since Photoshop has 12 as MAX quality or 100% so "4" is 1/3 or about 33.33% of the original. So you only need to save ONCE at 33% to see
the
difference, and you don’t even need to save once to know 33.33% won’t
be as
good as 100%

Or you save the 2nd time as 100% of 33.33% you will only get 100% of 33.33% *not* 100% of the original, so your test won’t make any sence.

Test repeated at Maximum quality of 12 every save. Yes, it takes many more repetitions for the quality degradation to be obvious, but it’s still there. And no, a quality level of 4 is not a strict 33% of original quality. In this case, the uncompressed bmp file is 900kb, and the jpg after only 1 compression is 63kb. After 40 repetitions it is 58kb. Don’t tell me there’s no data loss. The file went from 63kb to 58kb without any changes. Where did those 5kb go? Not to mention how it was reduced to 1/15th the uncompressed size. JPG causes quality loss. Plain and simple. You can minimize the degree of loss by cranking the quality up, but you’ll still lose quality every time you de-compress and re-compress it.
J
Joe
Apr 14, 2004
"Darrel Hoffman" wrote:

I don’t know why you have to waste your time to do that kind of test,
and
why you need a test to know it will show some difference.
Since Photoshop has 12 as MAX quality or 100% so "4" is 1/3 or about 33.33% of the original. So you only need to save ONCE at 33% to see
the
difference, and you don’t even need to save once to know 33.33% won’t
be as
good as 100%

Or you save the 2nd time as 100% of 33.33% you will only get 100% of 33.33% *not* 100% of the original, so your test won’t make any sence.

Test repeated at Maximum quality of 12 every save. Yes, it takes many more repetitions for the quality degradation to be obvious, but it’s still there. And no, a quality level of 4 is not a strict 33% of original quality. In this case, the uncompressed bmp file is 900kb, and the jpg after only 1 compression is 63kb. After 40 repetitions it is 58kb. Don’t tell me there’s no data loss. The file went from 63kb to 58kb without any changes. Where did those 5kb go? Not to mention how it was reduced to 1/15th the uncompressed size. JPG causes quality loss. Plain and simple. You can minimize the degree of loss by cranking the quality up, but you’ll still lose quality every time you de-compress and re-compress it.

If 4 out of 12 isn’t 1/3 then beat me, cuz I don’t know what else to say. If you SAVE & SAVE &SAVE & SAVE as max quality then the quality (pixel) may change a little, just like a 100 dollar bill if you keep rubbing it over and over then the picture will fade a little at a time, but it still worth $100.

Cranking up the quality won’t give you better quality, just like counting the same $1 bill 100-times won’t make it turns into $100 but you just count it 100 times, and still worth more more than $1. You save & save & save is different than decompress & recompress.
H
Hecate
Apr 15, 2004
On Wed, 14 Apr 2004 17:04:38 -0500, (Joe) wrote:

If 4 out of 12 isn’t 1/3 then beat me, cuz I don’t know what else to say.

It assumes that the scale is arithmetical. IIRC, it isn’t.



Hecate

veni, vidi, reliqui
J
Joe
Apr 16, 2004
Hecate wrote:

On Wed, 14 Apr 2004 17:04:38 -0500, (Joe) wrote:

If 4 out of 12 isn’t 1/3 then beat me, cuz I don’t know what else to say.

It assumes that the scale is arithmetical. IIRC, it isn’t.

If you just think about it then you will have it figured out.

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

Related Discussion Topics

Nice and short text about related topics in discussion sections