Results 1 to 13 of 13

Thread: JPEG Compression (etc.) Artifacts

  1. #1
    John Morton's Avatar
    Join Date
    Aug 2012
    Location
    New York NY USA
    Posts
    459

    JPEG Compression (etc.) Artifacts

    There has been ongoing discussion here regarding image quality degradation associated with using the JPEG file format. A general truism that has emerged in defense of JPEGS is that "you can't really see any difference between a JPEG and any other file format, so as long as you limit the amount of edit/saves performed JPEGs are fine."

    I've always disagreed (although perhaps not openly) with that, being a "TIFF person" myself who uses JPEGs only as a final step in editing, when outputting a file to be used on the Internet or for printing through other than my own color laser printer.

    To illustrate my point, I've processed a file which was edited as a TIFF (converted from RAW) and saved once as a final output JPEG. I've opened that file, converted it back into a 16 bit TIFF, then applied a variety of editing processes to accentuate the blocks of pixels that are produced as part of the JPEG compression process.

    This isn't a scientific experiment; but the newly processed file (saved in JPEG format) is shown below with the original JPEG file from which it was derived:

    JPEG Compression (etc.) Artifacts

    My contention remains: as with safety protocols that govern the cleaning of equipment for micro-organisms and other contaminants in food and drug industries; just because you can't see something, doesn't mean it isn't there.

    Magnify to 100% and you will see what I mean.

  2. #2
    DanK's Avatar
    Join Date
    Dec 2011
    Location
    New England
    Posts
    3,714
    Real Name
    Dan

    Re: JPEG Compression (etc.) Artifacts

    then applied a variety of editing processes to accentuate the blocks of pixels that are produced as part of the JPEG compression process.
    Interesting, but for most purposes, wouldn't the issue be the extent of degradation without editing designed to exacerbate it? After all, if you convert to JPEG to send an image to a lab, they don't try to degrade the image; they use it as you send it.

  3. #3

    Join Date
    May 2012
    Location
    northern Virginia suburb of Washington, DC
    Posts
    17,917

    Re: JPEG Compression (etc.) Artifacts

    Quote Originally Posted by John Morton View Post
    just because you can't see something, doesn't mean it isn't there.
    When it comes to photography, I would counter that with the idea that it doesn't matter that it's there if you can't see it. A perfect example is the presence of noise in the file. If the image is being shown in a size that you can't see the noise, it doesn't matter that it's present.

  4. #4
    John Morton's Avatar
    Join Date
    Aug 2012
    Location
    New York NY USA
    Posts
    459

    Re: JPEG Compression (etc.) Artifacts

    Gentlemen, I respectfully submit to you that even if the human eye cannot see these discrete blocks of pixels which the JPEG file format introduces into an image, the fact that they are most certainly there inevitably means that they become a factor in how an image editing program such as Photoshop processes the image in the course of those calculations such software makes when applying any kind of enhancement or adjustment to said image.

    Personal, I prefer to avoid situations wherein I might find myself faced with unacceptable results after an editing session, due to the undetected presence of such JPEG artifacts at the onset of said editing session. To me, it is simply a question of "best practices."

  5. #5

    Join Date
    May 2012
    Location
    northern Virginia suburb of Washington, DC
    Posts
    17,917

    Re: JPEG Compression (etc.) Artifacts

    You might be interested in the best practices and thinking recommended by the American Society of Media Photographers with regard to the various file formats: http://dpbestflow.org/file-format/rendered-file-formats

  6. #6
    John Morton's Avatar
    Join Date
    Aug 2012
    Location
    New York NY USA
    Posts
    459

    Re: JPEG Compression (etc.) Artifacts

    Quote Originally Posted by Mike Buckley View Post
    You might be interested in the best practices and thinking recommended by the American Society of Media Photographers with regard to the various file formats: http://dpbestflow.org/file-format/rendered-file-formats
    Thanks for that link, Mike; very interesting material.

    With reference to an earlier post by Tom, with an excellent explanation of JPEG compression (Re: Image post processing and printing; RAW/TIFF Printing; message 14), it is interesting to note in the above image comparison I have posted just how much the effect of JPEG compression shows up in areas that are predominantly of color ("chrominance"), as compared to the areas that are more grayscale in nature ("luminance"):

    "JPEG does the following: First, you convert the file to YUV (typically, YUV 4:2:2), which shrinks the pixel data to 8-bits per channel from the original (with typical RAW or TIFF data, the format would be 16 bits per channel, but the actual data will normally be no more than 12 or 14 bits per channel). Further, the two color channels use only one value of chrominance for every two values of luminance ("luminance" == grayscale, "chrominance" == color). So the data has been massively reduced just by the conversion to YUV.

    "Next, the data is grouped into 8x8 clumps of pixels called "GOPs" (groups of pixels) and converted using the Discrete Cosine Transform (DCT) to frequency space. Then the luminance GOPs are subjected to a relatively gentle low-pass filter that throws away some of the frequency data in the GOP, and the two chrominance channels are subjected to what is typically a very aggressive low-pass filter. If you have ever*JPEG'ed an image with sharp colored edges (like, say, colored text in an image), you will almost always find the edges to become fuzzy due to the standard over-compression of the chrominance channels."

  7. #7

    Join Date
    May 2012
    Location
    northern Virginia suburb of Washington, DC
    Posts
    17,917

    Re: JPEG Compression (etc.) Artifacts

    I have a very different perspective, John, that by anecdotal experience is very, very different from all but perhaps 1% of the people participating in threads such as this one. Let's assume that I'm wrong by a factor of 20 and that my perspective is different from all but 20%.

    I have made a serious study of the various photographic technologies going back to its origin (actually the predecessors of its origin). As a result, all of that gobbledygook about GOPs, YUVs, etc. is really unimportant to me because I view photography in the context of centuries, not pixels. (I call it gobbledygook because I don't have the technical expertise to understand it and so few of the people who write about it take the time to put it in lay terms, which really is a shame.)

    That doesn't mean that what I call gobbledygook due to my lack of understanding shouldn't be important to others. However, I do think it's fair to say that if those same people who take the time to stress the importance of the technical issues haven't made a serious study of photography in each and every decade since its inception, they have a relatively myopic view of the craft.

    Moreover, maybe I'm wrong, but I would be willing to bet that the members of the American Society of Media Photographers are most concerned about getting hired and paid for their photography; everything else is probably secondary. Considering the amount of practical information that is provided at their website, notice that there seems to be no mention of YUVs, GOPs and the like. That's despite that they make considerable effort to explain the advantages and disadvantages of every single file format. (You might have noticed other discussions of the various file formats at their website that I did not point you toward.)

    I'll bow out of the conversation now, mostly because I'm not trying to convince anyone of the merit of JPEGs or any other file format. Instead, I'm suggesting that it's not necessary to get caught up in some technical details that at least the American Society of Media Photographers, who make a living at photography, don't embrace at their website pertaining to best practices...especially the details that can't be seen. Indeed, please keep in mind that your initial post stressed the importance of stuff that can't be seen.
    Last edited by Mike Buckley; 6th December 2012 at 01:55 AM.

  8. #8
    John Morton's Avatar
    Join Date
    Aug 2012
    Location
    New York NY USA
    Posts
    459

    Re: JPEG Compression (etc.) Artifacts

    Fair enough, Mike. For myself, I am just curious as to how these file formats affect the images which are saved in them, and, I want to use the format which best preserves image integrity.

    So to be fair, and in an attempt to not mislead anyone, I have processed a TIFF image using the same enhancement techniques (which accentuate edgelines); then I have saved that original (unenhanced) TIFF as a JPEG; then I have re-opened the JPEG, converted it back to a TIFF, and applied exactly the same enhancement techniques I used on the original TIFF. This is in fact a variation of a technique I use to define edgelines; and normally I use it to selectively accentuate distinct edges in images but in this case I have employed a variation which generates false colors from small image structures (rather than more subtly enhancing the edgelines of what can otherwise be more or less indiscernible structures and elements within an image).

    Finally, I have extracted the difference between the two processed files.

    The results:

    JPEG Compression (etc.) Artifacts

    The original file.

    <^>

    JPEG Compression (etc.) Artifacts

    The enhanced TIFF image.

    <^>

    JPEG Compression (etc.) Artifacts


    The enhanced JPEG file.

    <^>

    JPEG Compression (etc.) Artifacts

    The difference between the enhanced TIFF and the enhanced JPEG.

    <^>

    Clearly the differences are least in the areas that are defined primarily by luminance values (the lightest and the darkest); but also of note is the fact that the entire image has been affected on a pixel level by one conversion to JPEG format, at the compression level of 8 (on the Photoshop scale of 12). Darker areas have the most difference; lighter areas, the least. Yes, "Difference" does produce the opposite effect but I have inverted the final image and enhanced it further to make the results a little clearer.
    Last edited by John Morton; 6th December 2012 at 05:19 AM.

  9. #9

    Join Date
    Nov 2009
    Location
    Provence, France
    Posts
    906
    Real Name
    Remco

    Re: JPEG Compression (etc.) Artifacts

    Any article trying to show anything with such pictures and and description of how they are obtained wouldn't make it past the editor..
    I know you claim this isn't a scientific study, but still...

  10. #10
    John Morton's Avatar
    Join Date
    Aug 2012
    Location
    New York NY USA
    Posts
    459

    Re: JPEG Compression (etc.) Artifacts

    Quote Originally Posted by revi View Post
    Any article trying to show anything with such pictures and and description of how they are obtained wouldn't make it past the editor..
    I know you claim this isn't a scientific study, but still...
    Normally, I would use this technique to accentuate object edges that have distinct yet subtle and virtually indistinguishable transitions. It is very useful for making virtually unidentifiable distinctions readily apparent, although I rarely use it to that degree (pulling details from video surveillance footage might be one possible application). Can it distinguish artifacts that result from JPEG compression? I can't say with one hundred percent certainty and I definitely would not attempt to publish an article on this without doing extensive testing that could be repeated and verified by others.

    If I use false color chrominance instead of grayscale luminance in my enhancing technique, the areas of the image which are being affected become readily apparent.

    Are different areas affected in different versions of the image if this technique is applied to a TIFF version, as well as to a version of the same image that has been converted to and saved as a JPEG, before being converted back to a TIFF and then processed in the same manner as the original TIFF?

    Yes.

    Have I isolated all the possible variables that might contribute to this very noticeable difference?

    No.

    Do these differences seem to correspond with actual object edges within the images, or does it appear that some degree of JPEG artifacting has been enhanced?

    Both possibilities seem apparent.

    Do my results correspond to what might be expected, given what I now know about the JPEG conversion/compression process?

    Apparently.

    Does that apparent consistency lead me to conclude that I would be better off editing my images in TIFF format, or in JPEG format?

    Since it seems to me that some editing processes which I might employ could end up augmenting latent JPEG artifacts along with whatever image detail they are intended to enhance, I think I'll stick with using TIFFs.

    Now I am of course "cheating" here a bit because I have in the past used this technique upon highly compressed and frequently saved JPEGS, so I know very well that on files like that it will REALLY bring out the JPEG compression artifacts even as it defines the edgelines of such images. In such cases, the edgeline enhancement and the JPEG artifacting are easily distinguished from each other by the naked eye. The example I am using here is one where the effect of JPEG compression is very minimal; yet, it can still be made quite apparent and the effect of JPEG compression here is easily discernible as a fact.
    Last edited by John Morton; 6th December 2012 at 08:33 AM.

  11. #11

    Join Date
    Nov 2009
    Location
    Provence, France
    Posts
    906
    Real Name
    Remco

    Re: JPEG Compression (etc.) Artifacts

    OK, I'll bite.

    First point, you do not edit a TIFF or JPEG file. You translate an image stored as TIFF or JPEG to the internal representation of the editor and edit that. Iow,
    taking a JPEG, and transforming it to a TIFF before editing isn't of any use, it but adds a transformation of the image data (one that shouldn't in theory influence
    the end result, admitted).

    Then, about the techniques you applied:
    The edge enhancement techniques you used have their uses (artistic and scientific/forensic, the latter if they are correctly specified).
    I'm less convinced by the final image (where you show the difference between the TIFF and JPEG versions), and that for two reasons:
    1: you didn't specify if the original TIFF was 8 or 16 bit/channel, nor what colour depth was used internally, and that will have an influence
    on the exact positions of the edges, and on their apparent sharpness.
    2 (more importantly): you needed to enhance that image to show the differences, but you don't show anything to give us an idea of the
    difference before enhancement.

    Now, it is well known that JPEG will cause some degradation in the image. The point that is subject to discussion is whether the difference
    is visible in normal photographic use, where the aim is to produce images for appreciation.

    The only conclusion I can draw from your images here is that there is NO visible degradation after one transformation to JPEG, as it seems to
    require quite a bit of work to show any differences.

    So, if anything, if bringing out the differences requires that much work, JPEG seems a very decent format to store images in, which even allows the
    occasional edit. As there are quite a number of reasons to use JPEG for images that might require some editing, that seems to me a good thing
    (think of P&S camera's that don't produce RAW, situations where RAW is too time consuming, or when you know you'll be short on card space).

    That is not to say that JPEG is a good intermediate format when working in RAW. It isn't, for that use TIFF, PNG, or another lossless format. (and
    preferably, use 16 bit/channel).

    @Mike: not sure your take is so much different from others' here. Others might be more interested in technical details, but for at least some others
    that's in part a matter of curiosity, and perhaps 'informed choice': if you don't know what happens 'under the hood', you might not recognise the limits
    of the techniques as easily.

    Just out of curiosity: how many here have images printed for anything other than a JPEG file?

  12. #12

    Join Date
    Dec 2010
    Location
    Greytown, New Zealand
    Posts
    190
    Real Name
    Tim

    Re: JPEG Compression (etc.) Artifacts

    Quote Originally Posted by revi View Post
    Just out of curiosity: how many here have images printed for anything other than a JPEG file?
    FWIW I NEVER convert to JPEG before printing.

    Mind you, exactly what file format transformation, if any, may be made "under the hood" in Lightroom's print output module is not clear.

    (That's different, of course, from a colour profile transformation, which is necessary to translate colour data from the editing colour space to the colour space space appropriate for whatever paper/ink I'm using.)

    Cheers

    Tim

  13. #13
    John Morton's Avatar
    Join Date
    Aug 2012
    Location
    New York NY USA
    Posts
    459

    Re: JPEG Compression (etc.) Artifacts

    Quote Originally Posted by revi View Post
    OK, I'll bite.

    First point, you do not edit a TIFF or JPEG file. You translate an image stored as TIFF or JPEG to the internal representation of the editor and edit that. Iow,
    taking a JPEG, and transforming it to a TIFF before editing isn't of any use, it but adds a transformation of the image data (one that shouldn't in theory influence
    the end result, admitted).

    Then, about the techniques you applied:
    The edge enhancement techniques you used have their uses (artistic and scientific/forensic, the latter if they are correctly specified).
    I'm less convinced by the final image (where you show the difference between the TIFF and JPEG versions), and that for two reasons:
    1: you didn't specify if the original TIFF was 8 or 16 bit/channel, nor what colour depth was used internally, and that will have an influence
    on the exact positions of the edges, and on their apparent sharpness.
    2 (more importantly): you needed to enhance that image to show the differences, but you don't show anything to give us an idea of the
    difference before enhancement.
    Those are good points and are exactly the issues of methodology that I was referring to when I said: "Have I isolated all the possible variables that might contribute to this very noticeable difference?

    "No."

    In addition, there would be considerations related to the lossless compression of the original RAW file in-camera, and the conversion into the TIFF I started editing from.

    Your first point, "you do not edit a TIFF or JPEG file," is just an objection based upon semantics: functionally, changes made during editing can be saved as a different file using "Save As" but the END INTENT is to alter the appearance of the original file in question.

    I must agree that the whole part of the exercise is this: "Now, it is well known that JPEG will cause some degradation in the image. The point that is subject to discussion is whether the difference is visible in normal photographic use, where the aim is to produce images for appreciation."

    Now, I am not trying to undermine the confidence of those who have no other option but to use JPEG as their primary file format; but I would like to highlight the very visible difference I have seen between what a technique I regularly use does to the edges it is meant to enhance (contour lines, on the right) and JPEG artifacts (on the left) which it can also enhance and render all too visible from their previously indiscernible state:

    JPEG Compression (etc.) Artifacts
    Last edited by John Morton; 6th December 2012 at 08:13 PM.

Posting Permissions

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