JPEG degradation

Discussion in 'Digital Photography' started by TSKO, Jan 26, 2007.

  1. TSKO

    TSKO Guest

    I was reading a photography book by Bryan Peterson and he says something in
    it I never knew. He said that opening JPEG's over and over........with time
    they will degrade to the point to where they dont open anymore.

    My question is, if on a screen saver you are doing a slide show with all the
    pictures that you took, does this count as 'opening' and 'closing' of a JPEG
    and will those degrade over time?
     
    TSKO, Jan 26, 2007
    #1
    1. Advertisements

  2. TSKO

    Bert Hyman Guest

    In "TSKO"
    That's only possible if you re-save the file after changing it somehow.

    Simply opening the file to view it and then closing it without writing
    to it will not change the file.

    If the viewing software you're using always re-writes the file whenever
    you open it for simple viewing, toss it and get something else.
     
    Bert Hyman, Jan 26, 2007
    #2
    1. Advertisements

  3. If they are opened and not RE-SAVED, there should be no problem,
    I believe.
     
    Paul D. Sullivan, Jan 26, 2007
    #3
  4. That doesn't make sense to me. Perhaps he meant that opening /and
    saving/ a JPG multiple times incrementally degrades the image quality.

    It seems to me that simply displaying an image should do nothing
    whatsoever to the source file.
     
    Steve Koterski, Jan 26, 2007
    #4
  5. TSKO

    ray Guest

    What happens is that every time you SAVE a jpeg image it is recompressed.
    There was already some degradation the last time it was SAVED or created,
    so it gets worse. It does not matter in the least how many times you open
    the file.
     
    ray, Jan 26, 2007
    #5
  6. TSKO

    ray Guest

    Matters not an iota if you change it or not. Saving it will always cause
    additional degredation.
     
    ray, Jan 26, 2007
    #6
  7. TSKO

    Bert Hyman Guest

    Why? If the app re-writes the same series of bytes back onto disk that
    it read, there will be no change in the file or the resulting image.
     
    Bert Hyman, Jan 26, 2007
    #7
  8. This is nonsense. Opening the file doesn't change the file. This is
    trivially easy to demonstrate using file-compare programs.
    No.

    The situation that's an issue is when you open, change, and *save* the
    jpeg. It goes through and re-compresses it again, and because there are
    changes, some of the damage this time is *different* from the damage the
    first time. (I say "damage"; jpeg is a lossy compression format, that's
    how it gets such small file sizes.)
     
    David Dyer-Bennet, Jan 26, 2007
    #8
  9. Matters not an iota if you change it or not. Saving it will
    I think in almost all cases, it does cause degredation. At least
    it seems that way to me based on my own experience.

    JPG is not quite like MP3 audio, which while lossless, works on
    specific frequencies at a given bit depth.

    Say you have an MP3 sound file and convert it to 32 kbps, 16 bit,
    22 khz Mono. If you use the same program to encode, it should
    use the same methodology, which would include eliminating certain
    very high and very low frequencies, always according to the same
    formula. When processing, no new frequencies are introduced that
    can be eliminated later, I believe.

    But with JPG, each time you save the file, the entire image is
    altered, and each time it is edited, the entire image is
    processed and saved. It's not limited to specific "colors" or a
    range of pixels in specific areas, I believe, so degredation
    always occurs.
     
    Paul D. Sullivan, Jan 26, 2007
    #9
  10. I haven't tried to conduct the test, and the meta-data in the file might
    make the test hard to run with stock software.

    However, when you open a jpeg file, the file is translated into a full
    bitmap as it's read into memory. If you now save the file, it has to be
    re-compressed into a jpeg.

    The question is, if you compress a file to jpeg (losing some data),
    expand that jpeg to a full bitmap, and then compress that bitmap to jpeg
    using exactly the same quality settings -- will the result be identical
    to the first jpeg, or not? (I'm not talking about whether it looks
    about the same to a quick glance on the screen; I'm talking about
    whether the actual image bitmap represented is the same, or not). I
    don't know the answer to this, and when I start thinking about how to
    conduct the tests, I get either a very quick and simple answer of "yes",
    or else the testing requirements get more and more complex very quickly.
    So I haven't done it yet.

    Just *copying* a jpeg file cannot cause further degradation; reading the
    bytes from disk and writing them to another area of disk makes an exact
    copy. (Well, except that there could be an undetected read error, or an
    undetected write error.)
     
    David Dyer-Bennet, Jan 26, 2007
    #10
  11. TSKO

    GMAN Guest


    BULLLL shit , that would only happen if you have your software set to change
    the compression ratio or from standard to progressive jpeg or the like. I use
    Thumbsplus, and have it set to not change anything from the original settings
    of the source jpeg when i crop files.
     
    GMAN, Jan 26, 2007
    #11
  12. TSKO

    ASAAR Guest

    Yes, that's possible, but . . . it's very unlikely that any app.
    will be able to write the same bytes back to the disk because to do
    that it would have to keep two copies of the image in memory, the
    original as well as the expanded image, and I doubt that any apps.
    do that. Checking one JPG picture produced by my camera shows that
    after loading the 1.81MB file into memory it was expanded to
    11.08MB. Using Irfanview to immediately save the jpg after opening
    it, the size on disk increased to 2.19MB. All "Save" options were
    chosen to try to prevent changes, such as not stripping EXIF data,
    IPTC data, nor JPG comments. Choosing "Save Quality" was the
    problem, as I had no way to determine the quality used by the
    camera. Even if I had known what it was, the JPG file had to have
    undergone expansion and compression, and from other recent threads
    it should be apparent that even if the photo app. used the same
    compression algorithm as the camera, it would be "lossy" and the
    file would have changed.
     
    ASAAR, Jan 26, 2007
    #12
  13. TSKO

    ray Guest

    The answer is - no it will not be the same. In order for it to be the
    same, you'd have to start with the same bitmap - but you're not, because
    the jpeg was altered from the original image - when you read in the jpeg
    you can't get what you had before it was saved.
     
    ray, Jan 26, 2007
    #13
  14. TSKO

    ray Guest

    Because it won't be rewriting the same series of bytes. It will perform a
    'fresh' compression on the image in memory.
     
    ray, Jan 26, 2007
    #14
  15. TSKO

    Joan Guest

    I've just done a quick test in Photoshop.
    Opened an NEF and saved to jpg. File size 3624KB
    Open that jpg and "save as" with compression set to 12. File size
    3669KB
    Open that jpg and "save as" with compression set to 12. File size
    3679KB
    Open that jpg and "save as" with compression set to 12. File size
    3685KB
    Open that jpg and "save as" with compression set to 12. File size
    3690KB

    No editing to the files at any stage.

    --
    Joan
    http://www.flickr.com/photos/joan-in-manly

    : On Fri, 26 Jan 2007 02:50:33 +0000, Bert Hyman wrote:
    :
    : Because it won't be rewriting the same series of bytes. It will
    perform a
    : 'fresh' compression on the image in memory.
    :
     
    Joan, Jan 26, 2007
    #15
  16. TSKO

    ASAAR Guest

    Good definitive test. Unless . . . Photoshop has decided to
    append an encrypted copy of the CPU's serial number every time it
    saves. <g>

    "Paranoia strikes deep. Into your life it will creep." -- For What
    It's Worth / BS
     
    ASAAR, Jan 26, 2007
    #16
  17. TSKO

    Phil Wheeler Guest

    Opening and closing does not affect them, so long
    as you don't save a new version over the original.
    So if you do edit one, best to save it with a
    new name and keep your original intact.

    Phil
     
    Phil Wheeler, Jan 26, 2007
    #17
  18. I'm getting tired of this argument.

    So, since I couldn't find a theoretical or rhetorical way to really
    settle it, I finally sat down and ran the experiment. And documented it.

    In the case I tested, resaving a JPEG caused image change, even though
    no editing whatsoever was done.

    I made a short article, exhibiting the two versions of the file and a
    visual map of the differences between them (very small, but definitely
    present). The article is at
    <http://dd-b.net/dd-b/Photography/Articles/resaving-jpeg/>.

    To be truly pedantic, of course, this only demonstrates that in one
    particular case an image is changed by resaving a JPEG. However, there
    should be detailed enough instructions there for anybody to reproduce
    the experiment on various other images.

    I haven't tried it with a pure white image, for example, but I think
    it's quite possible that resaving that wouldn't result in degradation.
     
    David Dyer-Bennet, Jan 26, 2007
    #18
  19. TSKO

    Joan Guest

    I just repeated the test but with the compression set to 6 and in each
    case the file was 729KB.

    --
    Joan
    http://www.flickr.com/photos/joan-in-manly

    : I've just done a quick test in Photoshop.
    : Opened an NEF and saved to jpg. File size 3624KB
    : Open that jpg and "save as" with compression set to 12. File size
    : 3669KB
    : Open that jpg and "save as" with compression set to 12. File size
    : 3679KB
    : Open that jpg and "save as" with compression set to 12. File size
    : 3685KB
    : Open that jpg and "save as" with compression set to 12. File size
    : 3690KB
    :
    : No editing to the files at any stage.
    :
    : --
    : Joan
    : http://www.flickr.com/photos/joan-in-manly
    :
     
    Joan, Jan 26, 2007
    #19
  20. TSKO

    Paul Mitchum Guest

    The reason JPEG is called 'lossy compression' is because it loses data,
    even at the highest quality settings. Even just opening and re-saving to
    JPEG loses data.

    Try it. Make and save an image with some text in it (text compresses
    poorly under JPEG). Open it and save it again at quality level 6 or so.
    Open the newly saved version and save it again. Do this a few times.
    You'll see it degrade as you go. I say to use quality level 6 because
    the effect will show up more quickly that way. The highest quality
    settings work the same way, just not as drastically.

    Here's what happened when I tried it:
    <http://farm1.static.flickr.com/146/369587648_85819d0ce7_o.jpg> This is
    with Photoshop.

    Whether this matters to you or not is another story entirely. You might
    be perfectly happy with the degradation from one generation to the next.
    But the fact is: The degradation is there.

    There's one exception, though: Lossless rotation. Some math dude came up
    with a way to preserve all the data in a JPEG while rotating it 90
    degrees (or multiples thereof). Find out here:
    <http://sylvana.net/jpegcrop/>
     
    Paul Mitchum, Jan 26, 2007
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.