Ugly Hedgehog - Photography Forum
Home Active Topics Newest Pictures Search Login Register
Links and Resources
Study of the effect of multiple writes on jpg files
Nov 4, 2020 15:27:29   #
DirtFarmer Loc: Escaped from the NYC area, back to MA
 
20201104


Abstract

Much has been written about the degradation of a jpg image with successive rewrites due to the lossy nature of the jpg compression. Little has been written about the degree of degradation or how bad the degradation becomes and how many rewrites it takes to produce significant image degradation. For that reason I decided to do the experiment to evaluate the rate of degradation as a function of number of rewrites. The results of this study were not what I expected, given the handwaving arguments that abound in the various forums where this has been discussed, basically claiming that the degradation is a continuing process as many times as an image file is rewritten.

This study shows that much, if not most, of the degradation occurs in the first writing of the jpg file. The degree of degradation, as expected, will depend on the “quality factor” specified in the program doing the rewriting, since that determines the degree of lossy compression. However, instead of finding the image degradation continuing unabated as long as the rewrites continue, the degree of degradation saturates at some point. In other words, the image degradation will increase with rewrites to a point, after which there will be no further degradation. That point will depend on the “quality factor” used for the rewrites.

This study is too large to fit onto a UHH post (limited to 15000 characters) so it needs to be referred by a link. A PDF of the study is here

Reply
Nov 5, 2020 05:37:55   #
kymarto Loc: Portland OR and Milan Italy
 
Thanks!

Reply
Nov 5, 2020 08:27:27   #
Delderby Loc: Derby UK
 
DirtFarmer wrote:
20201104


Abstract

Much has been written about the degradation of a jpg image with successive rewrites due to the lossy nature of the jpg compression. Little has been written about the degree of degradation or how bad the degradation becomes and how many rewrites it takes to produce significant image degradation. For that reason I decided to do the experiment to evaluate the rate of degradation as a function of number of rewrites. The results of this study were not what I expected, given the handwaving arguments that abound in the various forums where this has been discussed, basically claiming that the degradation is a continuing process as many times as an image file is rewritten.

This study shows that much, if not most, of the degradation occurs in the first writing of the jpg file. The degree of degradation, as expected, will depend on the “quality factor” specified in the program doing the rewriting, since that determines the degree of lossy compression. However, instead of finding the image degradation continuing unabated as long as the rewrites continue, the degree of degradation saturates at some point. In other words, the image degradation will increase with rewrites to a point, after which there will be no further degradation. That point will depend on the “quality factor” used for the rewrites.

This study is too large to fit onto a UHH post (limited to 15000 characters) so it needs to be referred by a link. A PDF of the study is here
code 20201104 /code br br b Abstract /b br b... (show quote)


Unfortunately the link won't work for me, but, when you write "much, if not most, of the degradation occurs in the first writing of the jpg file" do you mean when the JPG is first created? If so, that is the 100% JPG having discarded un-necessary info, not degradation. Years ago I carried out a similar study, but perhaps a shorter one. My findings were that, between each of all following edits saved at 100%, there were no noticeable differences. There were noticeable differences between the original JPG and the last in the study, being perhaps #15 in the series.

Reply
 
 
Nov 5, 2020 09:16:16   #
DirtFarmer Loc: Escaped from the NYC area, back to MA
 
Delderby wrote:
Unfortunately the link won't work for me, but, when you write "much, if not most, of the degradation occurs in the first writing of the jpg file" do you mean when the JPG is first created? If so, that is the 100% JPG having discarded un-necessary info, not degradation. Years ago I carried out a similar study, but perhaps a shorter one. My findings were that, between each of all following edits saved at 100%, there were no noticeable differences. There were noticeable differences between the original JPG and the last in the study, being perhaps #15 in the series.
Unfortunately the link won't work for me, but, whe... (show quote)


Sorry the link didn't work. I used the link https://smallfarm.netfirms.com/Documents/JPG%20Compression%20Study.pdf because it uses a secure server that UHH seems to prefer. My normal server would use http://small-farm.org/Documents/JPG%20Compression%20Study.pdf

If that doesn't work, I placed the paper in Dropbox at https://www.dropbox.com/s/nqkmy2qb3sil6so/JPG%20Compression%20Study.pdf?dl=0

One of the things about this study is that instead of depending on by-eye comparisons of two images, I use a numeric approach: converting the images into numeric arrays and finding the RMS difference between them. That gives a quantitative assessment of the difference.

I used the word "degradation" because that is how most people describe the effect of the lossy compression. The word "difference" might be more accurate. Using IrfanView or FastStone I can write a new jpg from an image with a "Quality Number" between 1 and 100 where 100 is the least compresssion and 1 is the most. Using by-eye comparisons (with a blink test) I can't usually see any difference between an original and another image saved with a quality of 50.

Reply
Nov 5, 2020 09:45:45   #
Bayou
 
I've long been fascinated by this question. I too, have found that the degradation fear is over blown.

While the JPEG format does compress the available data when it's first made, it uncompresses temporarily when opened in a viewer or editor. So a subsequent save is a save of a large uncompressed amount of data, not of the already compressed (closed) file. It's not like copying VHS tapes over and over.

While I've never experimented by doing numerous saves with the same file, I have done quite a few with one or two edits/saves, and never detected any loss of quality when compared to a backup copy of the original.

Reply
Nov 5, 2020 11:32:34   #
camerapapi Loc: Miami, Fl.
 
When we began to use JPEG files we immediately saw its disadvantages. That was years ago. Modern JPEF files are different and they have excellent quality, more evident with some manufacturers than with others.

A great disadvantage to the JPEG files is their 8 bits nature. If shooting JPEG and there are many photographers that shoot JPEG, further manipulations in an editing software could damage the file. A 16 bits file is more tolerant of changes but an original JPEG file with little manipulation is a very good file that can be used for excellent enlargements. I have very good enlargements made from those files.

Understanding the limitations of JPEG is the best, simpler way to shoot great files.

Reply
Nov 5, 2020 17:45:47   #
Dean Sturgis
 
camerapapi wrote:
When we began to use JPEG files we immediately saw its disadvantages. That was years ago. Modern JPEF files are different and they have excellent quality, more evident with some manufacturers than with others.

A great disadvantage to the JPEG files is their 8 bits nature. If shooting JPEG and there are many photographers that shoot JPEG, further manipulations in an editing software could damage the file. A 16 bits file is more tolerant of changes but an original JPEG file with little manipulation is a very good file that can be used for excellent enlargements. I have very good enlargements made from those files.

Understanding the limitations of JPEG is the best, simpler way to shoot great files.
When we began to use JPEG files we immediately saw... (show quote)



I tried once a few years ago, I opened a jpg file did save as ver 2 opened that one save as again on to about 30 times. I could see no difference in image quality or size of the file in bytes. I guess the program (Paintshop) did not not recompress if I made no changes to the file. If I had edited the file each time the results might have been different.

Reply
 
 
Nov 6, 2020 02:17:17   #
Delderby Loc: Derby UK
 
Dean Sturgis wrote:
I tried once a few years ago, I opened a jpg file did save as ver 2 opened that one save as again on to about 30 times. I could see no difference in image quality or size of the file in bytes. I guess the program (Paintshop) did not not recompress if I made no changes to the file. If I had edited the file each time the results might have been different.


Yes - with probably all software - if nothing has changed it will merely copy or move the original file. If you open and save it will not do anything.

Reply
If you want to reply, then register here. Registration is free and your account is created instantly, so you can post right away.
Links and Resources
UglyHedgehog.com - Forum
Copyright 2011-2024 Ugly Hedgehog, Inc.