Skip to main content
Known Participant
December 9, 2008
Question

JPEG and color management

  • December 9, 2008
  • 62 replies
  • 12701 views
Hi. Is it impossible to get 100% identical colors (if we leave aside the jpeg compression artefacts) when saving a .jpeg file with Photoshop using the highest quality setting (12) ?
    This topic has been closed for replies.

    62 replies

    Known Participant
    December 9, 2008
    > Well calibrated and profiled monitors and printers are not 100% precise, and they all have to deal with rounding, imprecise quantities of ink, paper differences, imperfect calibration, etc.

    Yes of course. But the more varying factors you add, the worse your outcome will get. Hence the desire to limit differences whenever possible.

    > But, if a color is changed from 0,0,0 to 1,0,0 or 0,1,0, you won't see the difference. The colors that are most likely to show any visible changes are light neutrals and skin tones, and even in those, changing one digit will be inconsequential. If the numbers change too much, of course, it will be noticeable.

    You can easily verify it. Take original PNG source file. Save it as JPEG with highest quality settings (12) and compare the colors in square C9. Even with the very highest quality settings, you get a considerable differnce:

    PNG file: RGB=(198,180,163)
    JPG file: RGB=(198,181,165)

    --> difference=(0,+1,+2)

    A difference of (0,+1,+2) is certainly visible, especially if the original color is pure gray, because then, the jpeg's color would have a considerable cyan color cast.

    And don't forget, this is just the very first image that "crossed my way". Other images might lead to even bigger differences!

    (Somewhat unrelated, but if you read the abovementioned thread, you will see an example in which JPEG-decoding leads to differences of (+16,-2,-30))
    Known Participant
    December 9, 2008
    Mark,

    I followed the discussion and believe that your results are valid. But, if a color is changed from 0,0,0 to 1,0,0 or 0,1,0, you won't see the difference. The colors that are most likely to show any visible changes are light neutrals and skin tones, and even in those, changing one digit will be inconsequential. If the numbers change too much, of course, it will be noticeable. Well calibrated and profiled monitors and printers are not 100% precise, and they all have to deal with rounding, imprecise quantities of ink, paper differences, ambient viewing light, imperfect calibration, etc. There is no guarantee that the same exact file sent to the same exact paper and printer will reproduce exactly the same two times in a row, (in fact, I'd be surprised if they did), or that the custom printer profile will render colors perfectly, even if the colors are in gamut.

    If you find large color shifts, then we have a problem and some of the colors may really look different to our eyes. Have you found significant shifts? If so, I'd be interested in knowing.

    But miniscule shifts are essentially meaningless, especially when you consider the purpose of JPG's, which is to greatly shrink file size for continuous tone images. It's a lossy format. It's like converting a high quality audio file to MP3....data is lost, but I don't seem to notice it, even though it is there. Every time you make an edit in Photoshop, (even on a TIF or PSD file) data is lost, but this is considered acceptable if the overall image benefits.

    I don't mean to discourage your investigation as to exactly how jpg compression works and how it alters images. This is especially relevant if you are developing software or doing something esoteric. But, it doesn't surprise me that there are minor shifts in the numbers. My bigger concern is how far I can go before it becomes noticeable to my eye or I create ugly artifacts.

    Let me know if you find some significant color shifts. That would be interesting.

    Thanks,

    Lou
    Known Participant
    December 9, 2008
    Lou Dina, Thanks a lot for your take on it.

    >I agree with Ramon...I never use JPG for high quality work, only TIFF or PSD.

    me neither, I want to know how it works though.

    > you are talking about very small differences from the original, most of which will be unseen visually, at least at high quality compression levels. You may be able to see these differences at high magnification levels, but that isn't what JPG is for. ... you would be hard pressed to see a difference between a high rez, high quality jpg (level 10 or higher) and a TIFF, either on screen or in print, at normal magnification levels.

    You know, that is exactly what I've thought for all my life ... until some days ago. I used to think that JPEGs only suffer from the typical artefacts along hard edges or in areas with high local contrasts and that with the hightest possible quality settings these artefacts could only be seen at very high magnification levels. That's problem (A) of JPEGS.

    But as it turns out, aside from problem (A), JPEGs also suffer from another problem (B ), which has nothing to do with magnification level. From the demonstration above, you can see that the majority of color patches have wrong colors! (all white pixels in the picture above denote different pixels). You can see that the differences not only occur along the borders between color patches and around letters and numbers (problem A), but that the affected color patches have a wrong color for their entire area respectively (problem B ). These color patches could be 1 meter (or a couple of feet), too if you want, and they would still have the wrong color. So it has nothing to do with magnification.

    Try the detailed steps above for yourself and see the results. Compare the colors of the color patches in the JPEG file and in the PNG file.
    Known Participant
    December 9, 2008
    Mark,

    JPG files ARE color managed properly, which you can see by assigning or converting a JPG file inside Photoshop. I'm not intimately knowledgeable about exactly how the compression algorithm works, but I am guessing you are seeing the effects of rounding, compression, squeezing pixels that are 'nearly identical' to take on identical values, etc (sort of a gentler version of Indexed Color mode).

    As I read throughout this dialog, you are talking about very small differences from the original, most of which will be unseen visually, at least at high quality compression levels. You may be able to see these differences at high magnification levels, but that isn't what JPG is for.

    I agree with Ramon...I never use JPG for high quality work, only TIFF or PSD. Having said that, you would be hard pressed to see a difference between a high rez, high quality jpg (level 10 or higher) and a TIFF, either on screen or in print, at normal magnification levels. I only use JPG's for web, email, and those situations where someone just cannot accept a large TIF.

    Lou
    Ramón G Castañeda
    Inspiring
    December 9, 2008
    >And why are calibration targets available as jpeg files

    NEVER came across one I would use myself!
    Known Participant
    December 9, 2008
    ... ok how else can it be explained that the majority of patches have wrong colors even if stored with the highest possible jpeg quality settings (12) in Photoshop ?

    And why are calibration targets available as jpeg files, if the colors cannot be accurate ??
    Ramón G Castañeda
    Inspiring
    December 9, 2008
    >This thread is about color management issues with JPEG-encoding.

    I don't see the connection
    Known Participant
    December 9, 2008
    They are certainly experts.
    They made comments in another thread with another topic.

    This thread is about color management issues with JPEG-encoding. The other thread is about differences in JPEG-decoding and has nothing to do with color management.

    At least, that's the status quo of what we found out so far.
    Ramón G Castañeda
    Inspiring
    December 9, 2008
    Whoa!
    >Awaiting expert comment ... [hopefully]

    I see that Gernot Hoffmann and Chris Cox have already made comments on your thread in the Photoshop Windows forum. Just how much more expert would you expect any comments to be, Mark? :o
    Known Participant
    December 9, 2008
    Thanks a bunch for your help with the BMP, that's really kind of you. I'll post the findings made with that BMP in the abovementioned thread and give you credit for that.

    Awaiting expert comment ... [hopefully]