This is how bad JPEG compression is: (imagesize warning)

Garbz

No longer a newbie, moving up!
Joined
Oct 26, 2003
Messages
9,713
Reaction score
203
Location
Brisbane, Australia
Website
www.auer.garbz.com
Can others edit my Photos
Photos NOT OK to edit
Those of you who have been paying attention to the Equipment subforum will know I have been bored and decided to find out once and for all how bad filtes are on lenses. http://www.thephotoforum.com/forum/showthread.php?t=100830

Well I'm extending this to another hot topic. Lots of people here talk about storing of RAW files or TIFF files (better idea IMO), or my own personal favourite Large JPEGs. I work with RAWs and PSDs and finally archive in JPEG, and in the true sense of the word they are finished files stored for long term use. I.e. I will never re-open them and edit them for anything other than making a compressed version for email or web posting.

That is me. Others however may wish to re-edit their files in the future. Some people just can't put a file down and it gets constantly played with. I thought I'd have a look at how bad lossy JPEG compression really is:

Method and assumptions:
Firstly I would like to point out I did this test with the intention to break it. The image I chose for it was a sugar glider I photographed recently. Bokeh doesn't compress well with JPEG, the slight noise makes matters worse, the image has a lot of detail in the centre, is sharp, and above all it is mostly blue. Those of you who know how JPEG works and how the eye perceives colours may also know that the blue channel suffers the worst quality hit in JPEG compression.
An action was made in photoshop which opened the file and saved it as a Quality 12 (max possible) standard JPEG. I apologise about the colour the result ended up in my working colour profile ProPhoto so the colours look entirely out of whack on a web browser, but the detail is what we are after here. Those who want to see the image with it's proper colours simply save it and open it in photoshop or another ICC profile aware software, or get a mac and use Safari.
The open and save action was repeated, a lot.

1st Save from RAW, followed by 2,3 and 4:
DSC_7527-Edit01.jpg

DSC_7527-Edit02.jpg

DSC_7527-Edit03.jpg

DSC_7527-Edit04.jpg

At around the 5th you start noticing some of the gradients are no longer smooth:
DSC_7527-Edit05.jpg

The 10th is starting to look ugly:
DSC_7527-Edit10.jpg

The 25th shows severe compression artefacts:
DSC_7527-Edit25.jpg

Now at this point it starts getting really problematic. The compression artefacts are starting to eat into the detail on the sugar gliders coat. Image 50:
DSC_7527-Edit50.jpg

Finally 99:
DSC_7527-Edit99.jpg


Conclusion:
I started this test with JPEG at Quality 3 and Quality 5, but after seeing the full Quality 12 results there's no need to even post the others. It's known gradients don't compress well, but I was expecting more form a maximum quality JPEG after only 5 saves. It becomes unbearable at 10. If you're inclined to edit your images in the future, JPEG no matter how high quality is simply not the format for you. That said after only 1-2 saves the JPEG looks every bit as good as the RAW original.
 
Thanks for the cool demo. If you opened and closed without making any changes you would not lose any quality right?
 
Thanks for the test results! I open and then save in psd to work on. I only use the jpeg for prints.

Would this be considered "Animal Testing"??? ;)

Cute Sugarglider.... :)
 
Of course it wouldn't impact the quality if you don't save. So far there is no such thing as something which deteriorates when you only open it. Mind you the movie and record industry have been trying to do that for years... and failed every time.

The sugar glider was a reject photo. It doesn't look right bright. The photo I kept had the flash down -2EV was very dark yet looked much more natural.
 
Thanks for sharing your findings. This is an interesting subject, as I have always wondered to what extent a jpeg deteriorates over time.

I, too, would like to know whether the simple opening and viewing of the file causes any sort of malicious effects.

EDIT: thought so :)
 
I work everything in TIFF's. More data never hurt nobody and HD's are cheap anyway.
 
Wow very interesting to say the least. So just re-saving a Jpeg image 25 times gets you worse quality?

For some reason I used to use PNG-24 to save my pictures after I photoshopped them. I never noticed a loss of quality or anything, and I realized logos and such actually come out better saved as PNG.

Since my compact camera can't save images in TIFF or RAW format, just jpeg, after I photoshop them would it be a good idea to save them as a PNG like I used to? Will that prevent compression if I feel like re-editing them multiple times?

Thanks for the test Garbz!
 
First off, sorry for editing your picture Garbz, this is only for further research. (hope you don't mind)

I was curious if saving the image as a PNG-24 was a better alternate than JPEG in 100 quality, to avoid compression. Here are the results.

Original JPEG compared to Original PNG-24 (after being resaved off of the web only once)
Jpeg: (still looks fine)
zztest_1.jpg

PNG: (still looks fine)
png_1.png


JPEG compared to PNG-24 after 5 Saves
Jpeg: (you can notice some loss of quality now)
zztest_5.jpg

PNG: (looks good as the first save)
png_5.png


JPEG compared to PNG-24 after 10 Saves
Jpeg: (looks pretty bad now)
zztest_10.jpg

PNG: (looks good as first save)
png_10.png


Jpeg compared to PNG-24 after 20 Saves
Jpeg: (looks horrible now)
zztest_20.jpg

PNG: (looks exactly like first save still)
png_20.png



I think these results prove that saving your images as PNG-24 can be a better alternate than saving your photo as a JPEG with 100 quality at times. The png still retains quality from the upload to the internet too. The only downsides I can see about saving your image as a PNG is that some photography websites/ galleries won't let you upload PNG's there, just JPEG, etc.

Overall I couldn't find a significant difference between the PNG saved ten times compared to the ones saved once.

If any of you smarter people want to add to this or tell me if this is flawed somehow please do. This was just out of curiosity for me and I decided to share. (BTW, I'm not trying to steal your spotlight at all garbz, just trying to experiment more.) And maybe a different save type can produce the same results as the PNG too? I don't know, but for now I am going to save my photos as PNG-24. :wink:
 
PNG is lossless so saving it a million times won't affect its quality.

I'm not certain (and WAY too lazy to test right now), but I bet each save will be bit-for-bit identical (until you start editing it, of course!).
 
PNG is lossless so saving it a million times won't affect its quality.

I'm not certain (and WAY too lazy to test right now), but I bet each save will be bit-for-bit identical (until you start editing it, of course!).

That's my point. If PNG is lossless why aren't people saving their photos as that? I seem to be the only person I know of that ACTUALLY saves their photos as a PNG. (well recently I haven't been, but I have in the past for a reason I don't know, now I am going to for sure)

I know some people won't save their photos as a PNG because they have RAW or TIFF files, so I understand, but maybe some people that don't have that option should try resorting to PNG?

The only downside I have found with a PNG is that some sites/ galleries won't allow you to upload/ display them, but that's all.
 
[JR];1035263 said:
I thought PNGs were for small web graphics and animations... I may be wrong.

I believe that's what it was meant for, hence the name "Portable Network Graphics" but I believe it can have other uses. I mean if the quality comes out this good in photographs why can't they be used for this too?
 
The advantages of PNG is that it is lossless true, same with TIFF. I would suggest that people who re-edit old photos do so in PNG or TIFF or some other lossless format.

There are several reasons why I don't save in this format.

a) HDDs are cheap but ports on a RAID controller aren't. I would need 2 new HDDs and an Additional NAS box if I want to upgrade which is near $1000AU compared to a new $200AU HDD. At the moment I have more HDDs than computers to plug them into at the moment.
So my choice of file formats is space concious.

b) I've shown you can save JPEGs several times before the quality actually starts to deteriorate. For some people this may be sacrilege but for me it is an acceptable loss to get the file size down to a fraction of what it was previously.

c) I don't re-edit.

d) JPEGs are acceptable anywhere. If I go to show the file to someone right now I can do so with the comfort of knowing any software can open it regardless of how old. This is not the case with PNG which is only recently accepted in web browsers, and is definitely not the case with RAW which plenty of people in the beginners thread have shown to be unable to open even when looking for a way.

For me JPEG is ancient and reliable, and small. There are many better choices and if part d weren't important to me then I would probably save as a JPEG2000 which is lossy but no where near as bad as the standard JPEG.
 
The advantages of PNG is that it is lossless true, same with TIFF. I would suggest that people who re-edit old photos do so in PNG or TIFF or some other lossless format.

There are several reasons why I don't save in this format.

a) HDDs are cheap but ports on a RAID controller aren't. I would need 2 new HDDs and an Additional NAS box if I want to upgrade which is near $1000AU compared to a new $200AU HDD. At the moment I have more HDDs than computers to plug them into at the moment.
So my choice of file formats is space concious.

b) I've shown you can save JPEGs several times before the quality actually starts to deteriorate. For some people this may be sacrilege but for me it is an acceptable loss to get the file size down to a fraction of what it was previously.

c) I don't re-edit.

d) JPEGs are acceptable anywhere. If I go to show the file to someone right now I can do so with the comfort of knowing any software can open it regardless of how old. This is not the case with PNG which is only recently accepted in web browsers, and is definitely not the case with RAW which plenty of people in the beginners thread have shown to be unable to open even when looking for a way.

For me JPEG is ancient and reliable, and small. There are many better choices and if part d weren't important to me then I would probably save as a JPEG2000 which is lossy but no where near as bad as the standard JPEG.

hmm, pretty good reasons. But for me personally, I'm going to make the switch to PNG as I find myself re-editing a LOT.

And thank you for your original test too Garbz, now I know that re-editing is not the best idea when you save a file as a JPEG.
 
For me JPEG is ancient and reliable, and small. There are many better choices and if part d weren't important to me then I would probably save as a JPEG2000 which is lossy but no where near as bad as the standard JPEG.

JPEG 2000 has both lossy and lossless compression options. Many people in the CG industry use Jpeg2000 for use as lossless scrolling backgrounds or massive texture maps where lossy is unacceptable. JPEG2000 is probably the best pro choice for large BGs or Texture maps because the entire file doesn't need to load into memory, it's lossless, and supports 16bit, 12bit, and regular 8bit files. This makes it faster and less of a resource hog - which really matters allot when you're parallax scrolling 8 or 10 BG images of 64,000 pixels, with 10 or 20 3D objects each using 4,000 to 8,000 pixel textures. And you might be surprised actually at how common something like that is.
 

Most reactions

New Topics

Back
Top