JPEG is said to be a lossy quality image format so most people prefer PNG. When JPEGs are edited it seems the quality does degrade(it's demonstrated well in the documentation of GIMP). How can we calculate what is the rate of loss or is there any measure to determine the amount of loss with respect to the number of edits made?
-
I think this is way off topic. Jpeg compression has two very basic steps: 1) use a Discreet Cosine Transform to sort/identify high frequency information that can be discarded; and 2) quantize the resultant values to "bin" them so as to make them more easily compressed. As far as calculating a rate, perhaps if the "quality setting" is invariant, but still, this procedure is done on 8x8 blocks of pixels, so the amount of high frequency loss is non-uniform. I expect there can be estimates (rounding-error estimation is a thing), but this is better asked in a match stack– YorikFeb 16, 2016 at 15:20
1 Answer
It is not said, It is. :o)
And it is not that most people prefer PNG. Normally PNG is for some things like graphs and logos where you have plain colors to be viewed on screen.
JPG is an output format for photos, either on screen or for print. Notice the term output format, versus working format.
If you are editing several times a photo use an internal format, PSD for Photoshop, CPT for PhotoPaint, XCF for Gimp.
After that you generate an output file. Generate as many output files as you need.
Regarding your question there is no way to know the degradation, becouse people can simply play with the compression settings.
If you save 2 times the same picture with no editing with the exactly same settings, the first time will have more degradation than the second time, becouse the sampling is already done.*
Besides that, there are some variations on the compression algorithms themselves. 4:2:2, 4:4:4, etc.
If you edit something some parts must be analyzed and compressed again. So there is no way to know that.
*One note. If you are working on a file, and you do not close it you can keep working on the jpg file and save it many times.