About JPEG Images and Their Quality Degradation

About JPEG Images and Their Quality Degradation

You lose information when an image is saved in JPEG format. This is acceptable, unless you save the same image more than once. Let’s have a look at how much information you really lose.

The JPEG file format is widely used because of its small file size. You can use it on the internet, social media, and for print shops and albums. The file size can be so small because of its smart algorithms that can compress the file by throwing away the less important image data. Although there are smarter and better ways in doing this, for now the JPEG is still the standard.

Not every camera has the option to shoot in raw file format, like this Sony DSC-HV400v superzoom compact camera. Especially for photographers who use these kind of cameras, this article could be good to read.

First of all, I think the wisest thing to do is using the raw image data of the camera, and post processing your images yourself. If your camera can shoot in raw format, that is. The raw format allows you to use the maximum amount of information generated by the sensor. You can correct colors, exposure, and contrast without the penalty of image degradation. Up to a certain amount, of course. But you can also directly save your photo in JPEG format 

The software inside cameras can be used to give the in-camera JPEG a certain look. But this is very limited and it is less easy due to a number of different reasons. By saving the image as a JPEG in your camera, even in the best quality, you will throw away information. Not only the extra sensor information, but also due to image compression.

If you use in-camera JPEG images just the way it came off the memory card, and you don’t change anything anymore, then it is okay to do so. With most cameras the image is quality wise more than acceptable, as long as you save in the highest JPEG size available. But be careful with that file. Whenever you change anything in that JPEG, you will throw away information again when saving it a second time. And again a third time, and a fourth time. And so on.

Saving an image in JPEG format. I always choose the highest quality, although that might be unnecessary. Nevertheless, I used this setting for my experiment.

I became curious on how soon that information loss will be visible. We all read about it, we all know it happens, but a lot of photographers don’t realize what the effects are when you save a JPEG multiple times. That is why I took the time to generate a 1280 pixel JPEG image from a raw file, in the best possible quality, and save it over and over again. I wanted to see how often this could be done without losing the image.

I decided to open the original JPEG file in Photoshop 2020 and save it as a new second image. I opened that second image, to save it a third time as a new image. Next, I opened the third image and saved it again as a fourth new image. And so on, until I saved it 99 times. With each new file, the software compressed the image, reducing the image quality. This is what I saw happening

This is the JPEG file, generated from the RAW file, in Lightroom. This is the starting point.

After ten times saved, the quality of the file is reduced so much, you can see the artifacts appear. I already find this an unacceptable, unusable quality.

Just to see what will happen when the image is saved over and over again. After twenty times, the quality is very poor. This image can never be used, not even on social media like Facebook.

The image degradation continues and this is the result after thirty times saved. Nobody want their images to look like this.

This is how an image will look after you save it fifty times. Nobody will be saving their image that many times, but is good to see how terrible a JPEG will turn out if you save it over and over again.

After seventy times, this will be the result.

After ninety nine times saved, the image looks like this. It clearly shows how the quality will degrade.

When the image was saved a tenth time, I found it already unusable. I could have stopped there, but I wanted to see the result after 99 times. It was shocking to see the amount quality loss after only a few times. 

For this experiment I did not do any post processing. I just opened the file and saved it as a new file. I did the same experiment with an invert filter, every time I opened and saved the file, and the end result was the same.

This is the difference between the original JPEG from the raw file, and the file that has been saved for ninety nine times. It doesn't matter if you perform any post-processing or not, the result will be the same. Unless you post-processing will degrade the image even more of course.

A close inspection revealed to me, that the JPEG image has already significant quality loss after you save it six times, and to be honest, if you look real close to the five times saved image, there is already some quality loss visible.

Although I knew this would happen, I am surprised how much you lose after only six times. In a way it changed my thoughts about the JPEG file format.

This is the result after six times saved. I think this is the point where image degradation will become too obvious. This image has become unusable for high quality prints. The breaking point will also be depending on the complexity of the image, I presume.

I know there are photographers who insist on shooting in JPEG image format. And although I would not advise doing so, I can understand why. Perhaps they don’t know how to handle a raw file, or perhaps they are convinced this is the only honest way of photography. Or perhaps their camera has unique film simulations that produce amazing results, even in JPEG. There are also the photographers that don't have a camera that can save a raw image.

No matter what reason, I only can advise those JPEG shooters to be careful with their JPEG files, and never save that file a second time in JPEG format. Because every time you do, you will lose quality. If you insist on using JPEG, just make sure you keep the original JPEG on your computer and use it as the starting point of every correction you might do on that file. Always save the changed file as a new file, never overwrite the original. This way you will treat the original JPEG as a digital negative, from which you can work as a starting point.

Ninety nine files, each saved from the previous one, with a simple postprocessing performed that will not degrade the image even more. If you want to change your JPEG file, make sure you keep the original one original. Don't overwrite that file with the new version. Ever.

A few things might be interesting to know also:

  • Although you might not want to change anything to a JPEG, you might want to have a smaller version, or perhaps you want to level a horizon, or crop it, or you might opened it and save it by mistake. Saving it again might occur more often than you think.
  • Copying the JPEG file won’t affect the quality, only opening it and saving it again will do that.
  • Opening the JPEG and by saving it as a lossless TIFF or DNG file, you will prevent further degradation when working on the file.
  • When saving a JPEG as a TIFF of DNG file, you are better off shooting a raw file format in the first place.

I just want to point out, you have to be careful when you are shooting in JPEG. Keep the original file untouched. If you do, you will be alright.

Did you realize how soon image degradation will occur when saving a JPEG file again and again? And if you shoot JPEG, would you consider using raw files in the future, or will you continue shooting in JPEG and protect your files from saving it a second time? I would love to read about it in the comments below.

If you're passionate about taking your photography to the next level but aren't sure where to dive in, check out the Well-Rounded Photographer tutorial where you can learn eight different genres of photography in one place. If you purchase it now, or any of our other tutorials, you can save a 15% by using "ARTICLE" at checkout. 

Nando Harmsen's picture

Nando Harmsen is a Dutch photographer that is specialized in wedding and landscape photography. With his roots in the analog photo age he gained an extensive knowledge about photography techniques and equipment, and shares this through his personal blog and many workshops.

Log in or register to post comments
61 Comments
Previous comments

Yes. there is data loss at the 100 quality setting however this loss is quantized detail data that has no visual impact on the image (generally it is zero-coefficient data) and occurs only at the highest frequencies in the photograph. (Frequency here refers to how often a given coefficient appears in the jpeg process.)

Thanks for the clarification! You say there's no visual impact, but I assume that holds true if you don't do it multiple times as Mr. Harmsen did. He said he saved at 100 and visual degradation crept in after 5 or 6 times. That's a lot, of course, but that was the point of his article. Anyway, I'll be careful when I re-edit a picture.

My example is saved in 100%.

Jpeg is a lossy format. Got it. Thanks.

Happy to be of help

Actually it's not that obvious. As I discussed above, the cumulative loss should not occur if Adobe actually followed the JPG standard. So indeed, thanks for the help.

I am curious. Can you show me that. It would be interesting to see

Maybe I missed it, but I didn’t see any mention of the quality level & sub-sampling settings you used for your example. These can make a huge difference in the amount of degradation per re-save step.

I have made a screenshot of Photoshop with the settings panel. I used the standard setting, just like most would use, with the maximum quality

You may also enjoy the rotation example by Andrew Adams in https://web.stanford.edu/class/cs448f/lectures/1.2/Sampling.pdf around slide 55. You can try the same with actions in photoshop: rotate N times by 360/N degrees and see how much the image degrades. It's a different kind of loss, due to resampling.

Thank you for the link. The formulas and graphs are too much for me, and to be honest, I don't want to delve deeper into the math of resampling, but I get the idea.
My intention was, to show what regular people would encounter when using the software they have to save a JPEG time and time over again.
But it is good to know there is more to it. :)