Page 2 of 2 FirstFirst 12
Results 21 to 31 of 31

Thread: JPG Degradation

  1. #21
    Moderator Manfred M's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    22,162
    Real Name
    Manfred Mueller

    Re: JPG Degradation

    Quote Originally Posted by CatherineA View Post
    I had been reading that the data loss was in fact cumulative though and that is what prompted me to post the question.
    That is a common misconception found around the internet and is based on faulty assumptions of how "lossy" compression works. I would be shocked if the people making this statement have actually tested / researched to find out whether it is correct or not.

  2. #22

    Join Date
    Nov 2017
    Location
    Ottawa, Canada
    Posts
    383
    Real Name
    Catherine

    Re: JPG Degradation

    Thanks Paul. Yes, it would have helped if I had given some context. I got my first camera about a year ago and it only shoots JPEGs. Recently I started trying to learn some editing. I thought that only good could come of it and had been thinking of doing things like swapping out a drab sky or eliminating a blemish from a portrait. I almost thought that I was being more responsible toward my images by editing and editing. I'm a slow learner with these tech things, no doubt about it, and take plenty of congratulatory breaks -coffee breaks, cookie breaks, you name it. Was I ever disheartened to read that I could be losing quality all along the way.

    But, I've learned really helpful things form the responses to my post so I'm back on my way again.

  3. #23

    Join Date
    Feb 2012
    Location
    Texas
    Posts
    6,956
    Real Name
    Ted

    Re: JPG Degradation

    Quote Originally Posted by Manfred M View Post
    [cumulative degradation] is a common misconception found around the internet and is based on faulty assumptions of how "lossy" compression works. I would be shocked if the people making this statement have actually tested / researched to find out whether it is correct or not.
    Intrigued, I had to do a test. I set default JPEG in FastStone Viewer to 21% compression, max sub-sampling (4:2:0) and saved a TIFF as a JPEG 'save1' ... it was horrible, of course. But then I opened 'save1' made a small edit and saved that as 'save2' and did the same until I had four JPEGs to compare. Even at 800% zoom (nearest neighbor) they were identical !!

  4. #24
    Moderator Manfred M's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    22,162
    Real Name
    Manfred Mueller

    Re: JPG Degradation

    Quote Originally Posted by xpatUSA View Post
    Intrigued, I had to do a test. I set default JPEG in FastStone Viewer to 21% compression, max sub-sampling (4:2:0) and saved a TIFF as a JPEG 'save1' ... it was horrible, of course. But then I opened 'save1' made a small edit and saved that as 'save2' and did the same until I had four JPEGs to compare. Even at 800% zoom (nearest neighbor) they were identical !!
    Exactly! I went a bit further than you and did a similar test at 4 or 5 different quality levels and did / undid 20 - 25 edits on each, so somewhere between 100 and 120 different saves. The way I did and undid the edits, the first and last edits should have been identical. I put the first and last edit into two different layers and subtracted one from the other. Any artifacts from lossy compression should have shown up, but there were none.

  5. #25
    MrB's Avatar
    Join Date
    Feb 2011
    Location
    Hertfordshire, England
    Posts
    1,437
    Real Name
    Philip

    Re: JPG Degradation

    In the back of my mind is the vague memory of reading about the JPEG re-saving issue having something to do with the way the algorithms divide the image frame into blocks of pixels for compression, so that edits that might affect the pixel positions in the image frame (and therefore in the blocks) can cause more re-compression artefacts to appear on saving the image file. Might it be these effects that lead to the cumulative degradation that is often mentioned (but without explanation) in articles about the downsides of editing JPEGs?

    Cheers
    Philip

  6. #26

    Join Date
    Feb 2012
    Location
    Texas
    Posts
    6,956
    Real Name
    Ted

    Re: JPG Degradation

    Quote Originally Posted by MrB View Post
    In the back of my mind is the vague memory of reading about the JPEG re-saving issue having something to do with the way the algorithms divide the image frame into blocks of pixels for compression, so that edits that might affect the pixel positions in the image frame (and therefore in the blocks) can cause more re-compression artefacts to appear on saving the image file. Might it be these effects that lead to the cumulative degradation that is often mentioned (but without explanation) in articles about the downsides of editing JPEGs?

    Cheers
    Philip
    Yes, the blocks are 8x8px and the algorithm is by one Mr Huffman and tables called DCT are involved. By no means simple and I don't understand it much at all.

    There's an app called 'JPEGsnoop' which lists the tables for serious peepers.

    From my simple test, I'll speculate that maybe running the same tables on exactly the same size image has the same result. If the image size were changed (not by multiples of 8) between saves, maybe that could cause cumulative degradation.

  7. #27
    DanK's Avatar
    Join Date
    Dec 2011
    Location
    New England
    Posts
    8,836
    Real Name
    Dan

    Re: JPG Degradation

    For what very little this is worth, many years ago, when I bought my first, very primitive digital camera, which shot JPEG only, I did sometimes experience additional degradation with additional saves, if my hazy memory is correct. I recall it showing up as posterization. In recent tests, less thorough than Manfred's, I didn't see it. My guess is that in the case of those early experiences, the edits were sufficiently substantial that the image size did change substantially. Perhaps that's the reason, or perhaps I am remembering incorrectly.

  8. #28

    Join Date
    Feb 2012
    Location
    Texas
    Posts
    6,956
    Real Name
    Ted

    Re: JPG Degradation

    Quote Originally Posted by DanK View Post
    For what very little this is worth, many years ago, when I bought my first, very primitive digital camera, which shot JPEG only, I did sometimes experience additional degradation with additional saves, if my hazy memory is correct. I recall it showing up as posterization. In recent tests, less thorough than Manfred's, I didn't see it. My guess is that in the case of those early experiences, the edits were sufficiently substantial that the image size did change substantially. Perhaps that's the reason, or perhaps I am remembering incorrectly.
    In my recent test, I did try the maximum compression (10%) and it resulted in horrendous posterization, for what that's worth. So I set it to 21% instead.

    Here's the victim:

    JPG Degradation

    Here's the saves 1-4 each at 800% zoom (nearest neighbor, no smoothing):

    JPG Degradation

    The 8x8 blocks be clearly seen and there is little or no change with successive saves during that test.

  9. #29
    MrB's Avatar
    Join Date
    Feb 2011
    Location
    Hertfordshire, England
    Posts
    1,437
    Real Name
    Philip

    Re: JPG Degradation

    Quote Originally Posted by Manfred M View Post
    ...I would be shocked if the people making this statement have actually tested / researched to find out whether it is correct or not.
    I must plead guilty as charged with regard to writing the following in Post #6 -

    Quote Originally Posted by MrB View Post
    ...While making adjustments, the image is held in the computer's memory. When the image is then saved as a JPEG it will be compressed again, so some more data will be lost. If this cycle - load, edit, save as JPEG - is repeated, the loss of data will degrade the image quality some more at each iteration. Therefore, to maintain high quality, it is best to do all the editing in one session, so that the data is compressed only once more into the saved final JPEG...
    I have read similar to this on different occasions and at several locations on the Web, usually from people who are - much more experienced and knowledgeable (than me), committed to shooting raw, and often writing in the context of trying to discourage others from shooting JPEGs. Therefore I assumed that there must be some truth behind it. Consequently, when I edit JPEGs, I always try not to Save As more than once.

    However, this time with regard to Post #25, I tried an investigation. I loaded a test JPEG image from a point and shoot compact camera, then saved it as #00 using Save As. When I loaded it again, the only edit was to move the image one pixel across and one pixel down the image frame - I did this by adding a one pixel border all round the image - this was saved as #01. I repeated the load, edit, save as, several times. Each save was done at 50% compression. The extra loss of quality soon became noticeable, as shown here (best viewed in the Lightbox) - the first save #00 compared with the fifth edit #05 -

    JPG Degradation

    I don't intend to do any more tests but it would seem to me a not unreasonable guess that any editing which moves image pixels around in the image frame (cropping, horizon levelling, perspective transformation, rotation, resizing, etc.) could introduce extra and different JPEG artefacts, as the image is re-compressed when saving the file. If several such changes were made in different editing sessions, they might lead to cumulative image degradation becoming discernible in larger screen views or big prints.

    What do you think?

    Cheers.
    Philip

  10. #30
    Moderator Dave Humphries's Avatar
    Join Date
    May 2008
    Location
    Windsor, Berks, UK
    Posts
    16,748
    Real Name
    Dave Humphries :)

    Re: JPG Degradation

    Things worth bearing in mind/repeating;
    (written before seeing Philip's latest just above)

    1) Multiple saves of a jpg without closing the file (and editor?) between them is not a real test* as many already know, but I'll mention for clarity. (* because it remains in memory uncompressed, so you're not 'compounding' the artefacts)

    2) Your image edits between saves must be something that causes widespread recalculation of (ideally all) the 8x8 blocks, what that means depends upon picture content**. e.g. with a fine detail shot, say architectural; a rotation of a few degrees will likely cause this, where as cloning out a lamp post (and making NO other changes) will likely leave most of the image blocks unchanged.

    3) If you do a small crop (e.g. 3 pixels), it needs to include the top and left edges of the image, not just the right or bottom, where potentially, only the final column and last row will get their 8x8 blocks recalculated.

    4) Also of course, to 'compound' the artefacts and you need to open a different jpg file each time (i.e. the one you just saved)

    So unless you do the 'wrong' sort of edit (for image quality), you may not see much/any difference between properly done successive saves. (where 'properly' means ideally closing both the file and the app between "open, edit, save, close" cycles.

    It is very easy to inadvertently 'test' this in a way that won't exhibit problems, lulling you in to a false sense of security - only for it to bite you hard when the latest potentially prizewinning image happens to need all those adjustments that will cause problems and you edit it in multiple sessions.

    We've all been there; "that's great" you think, edit save close, job done - until someone points out it ain't level, so to save redoing the previous edits, you open the edited jpg and rotate, save, close. Next morning, you think, "I should have cropped that bit off the left hand side", so you open the latest (latest) jpg, make the change and save again and suddenly horrors (when viewed online or in a jpg viewer, not*** your editing app), the sky has posterised and all the fine detail is fuzzy! *** because in the editing app, you're still seeing it before the final compression.
    At this stage, you start looking at cameras that shoot RAW

    Hope that helps,
    Dave
    Last edited by Dave Humphries; 30th July 2018 at 07:50 PM.

  11. #31

    Join Date
    Feb 2012
    Location
    Texas
    Posts
    6,956
    Real Name
    Ted

    Re: JPG Degradation

    Quote Originally Posted by MrB View Post
    I don't intend to do any more tests but it would seem to me a not unreasonable guess that any editing which moves image pixels around in the image frame (cropping, horizon levelling, perspective transformation, rotation, resizing, etc.) could introduce extra and different JPEG artefacts, as the image is re-compressed when saving the file. If several such changes were made in different editing sessions, they might lead to cumulative image degradation becoming discernible in larger screen views or big prints.

    What do you think?

    Cheers.
    Philip
    Yes, I thought similarly in post #26: "If the image size were changed (not by multiples of 8) between saves, maybe that could cause cumulative degradation". Your test appears to confirm that. Ta!
    Last edited by xpatUSA; 31st July 2018 at 03:00 AM.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •