This content has been marked as final. Show 62 replies
I have this color chart (PNG file):
I open it with Photoshop CS3, and save it as JPEG with quality 12 and get this:
Most (but not all) of the colors are DIFFERENT to the picture above! The white pixels in this image denote different pixels:
How is this possible ?
Due to jpeg compression, there are obviously differences around hard edges (such as the borders between the color patches or around the letters and numbers), but there are also a lot of entire color patches which have different colors.
I used sRGB IEC61966-2.1 both as my RGB working color space and as embedded profile in the files. So this can't account for the differences, isn't it?
As far as I know, Photoshop disables even color subsampling with quality 12. Also, color subsampling wouldn't account for differences in a whole color patch.
So the only conclusion I can draw from that, is that .jpeg files cannot use color management (but why does the jpeg standard then explicitely forsee and promote the use of embedded ICC profiles in jpeg files ???) or that Photoshop somehow has a problem with color management when jpeg files come into play. Any ideas ?
Why are you saving it as a JPEG, a lossy format? For what possible purpose? <br /> <br /> Well, let's leave that aside, as it is really none of my business. :/ <br /> <br /> I downloaded the PNG straight from the browser to a folder (not my Desktop). I opened it with Photoshop 11, and saved one copy as a PSD, a TIFF, and a Quality-12 JPEG. I see nothing like what your image shows. Here's my JPEG on Pixentral: <br /> <br />c <a href="http://www.pixentral.com/show.php?picture=1vCQGy0rp4Cj826NOvgAtzKM40Z1" /></a> <img alt="Picture hosted by Pixentral" src="http://www.pixentral.com/hosted/1vCQGy0rp4Cj826NOvgAtzKM40Z1_thumb.jpg" border="0" /> <br />c Click on the thumbnail for the full image. <br /> <br /> Dragging the JPEG as a layer on top of the PNG, then setting the top layer to Difference blending mode, I get a solid black rectangle.
When you opened the original PNG, did you ASSIGN the sRGB profile to it?
>Dragging the JPEG as a layer on top of the PNG, then setting the top layer to Difference blending mode, I get a solid black rectangle.
Not only that, leaving the blending mode to Normal and toggling the visibility of the top layer off and on, I see no percetible difference in any of the colors.
Thanks for looking into it Ramón.
> When you opened the original PNG, did you ASSIGN the sRGB profile to it?
> Dragging the JPEG as a layer on top of the PNG, then setting the top layer to Difference blending mode, I get a solid black rectangle.
That's exactly what I did. Now use the magic wand with these settings:
sample all layers: yes
Fill the selection with white and you get the results I posted here. If your image is completely black (or white after selecting and filling), your images are really identical.
This would show, that there is either a problem with PS CS3, or with my settings somewhere.
Now I just went through the same exercise with your own JPEG (a3gencolorhighwwwfhoemdjv4.jpg) with identical results as those described above. No difference.
How are you determining the difference you think you see?
I compared the .jpeg file you uploaded to the original. I used an external command line program to compare the images, not in Photoshop in order to exclude the possibility of any wrong Photoshop settings on my behalf:
The result is:
Your .jpeg file is considerably different (so the black you were seeing, wasn't really black everywhere):
Compared to the original png file, 334103 of a total of 761000 pixels are different (=43.9%).
The different pixels are denoted in red in the following image:
[large image replaced with link]
> Now I just went through the same exercise with your own JPEG (a3gencolorhighwwwfhoemdjv4.jpg) with identical results as those described above. No difference.
Ramon, use the original png and the image your conversion to .jpeg as posted by you on pixentral. Did you use the magic wand as described above ?
Mark, <br /> <br /> When using the Magic Wand <i>(which I confess I don't understand what that is supposed to prove)</i>, I used your settings, but I also went to the "Refine Edge" button and zeroed out all the values (Radius, Contrast, Smooth, Feather, Contract/Expand), and the selection preview was on <i>"Preview the selection over a black background"</i>. <br /> <br /> The result was a black rectangle with non-continuous marching-ants lines over the spots where the dividing lines between the colors as well as the numbers and letters would be. I expect that to be the JPEG artifacts. <br /> <br /> Because the selection is NOT continuous, this happens when I Fill with White: <br /> <br />c <a href="http://www.pixentral.com/show.php?picture=1mCX2jLqoBGgGrx3neLL8FvolXqo0Z0" /></a> <img alt="Picture hosted by Pixentral" src="http://www.pixentral.com/hosted/1mCX2jLqoBGgGrx3neLL8FvolXqo0Z0_thumb.jpg" border="0" /> <br />c (screenshot) <br /> <br /> Now what?
Mind you, I am a notorious JPEG hater and avoid them like the proverbial plague. I only use them to upload screen shots or other images to Pixentral to illustrate a point.
Well, I went over much of the black rectangle at 3200% view and did
seedetect, by way of the Info Panel, some pixels with RGB values like 0,0,1 or 1,0.1 or 1,0,0.
Frankly, that's a hell of a lot better than I, as a JPEG hater, would have ever expected a damned JPEG to do, even at maximum quality. :D
Thanks for helping in this test despite hating JPEGs
Your screenshots proves that there are differences not only along hard edges (i.e. the borders between color patches), but that also whole color patches are affected.
This would mean, that color management isn't working properly with jpeg files. I hope someone with sound color management knowledge can confirm this or otherwise explain the problem.
> When using the Magic Wand (which I confess I don't understand what that is supposed to prove)
I try to explain once again:
1) Download the original source file (png) from the link above
2) open it in Photoshop and assign sRGB profile
3) save it as jpeg with highest quality settings possible (12)
4) open the jpeg file
5) add it as new layer over the png file
6) select "difference" as blending mode in the layers palette
7) now the whole image should appear almost black
7) select the magic wand tool (with abovementioned settings!)
8] click somewhere into the formerly gray area
explanation: you just selected all completely black pixels (0,0,0) i.e. all pixels that are identical in both layers
9) you should see "marching ants" forming rectangular patterns
10) invert the selection (Shift+i)
explanation: the selection now covers all the other pixels, i.e. all pixels which are different between both layers
11) create a new empty layer and select it in the layers palette
11) set the foreground color to white
12) fill the selection with white (alt+backspace on Windows, accordingly on Mac)
13) set the blending modes of all layers back to normal
explanation: you now have the image I posted above, i.e. you see all identical pixels in their respective color and all different pixels in white
The expected results would be white pixels along the borders between color patches, resulting from jpeg compression, but if color management works correctly there must not be entire color patches with the wrong color (i.e. white here)
> Frankly, that's a hell of a lot better than I, as a JPEG hater, would have ever expected a damned JPEG to do, even at maximum quality.
From my point ov view, jpeg artefacts (along hard edges, etc.) are expected to occur. But entire color patches with the wrong color must not occur if color management works correctly.
Thanks for the extensive explanation, Mark.
I must admit that I still don't quite grasp your methodology, nor do I understand how all that translates into a color management issue rather than a JPEG compression weakness. However, it's certainly not really conducive to re-thinking my aversion to JPEGs. :D
The bottom line is this: We opened a PNG file, saved it as JPG and compared both images in difference blending mode. In this mode all identical pixels are completely black (try it out with two copies of the same layer).
Our goal is to find out which pixels in the JPEG file differ from the PNG file (obviously there MUST be non-identical pixels, as JPEG is a lossy format!). As we know that identical pixels are completely black (as mentioned above), we want to find pixels that are NOT completely black.
How do we achieve this? With tolerance=0 the magic wand only selects pixel which have exactly the same color as the pixel we click on. So when clicking on a black pixel, the magic wand selects all the completely black pixels in the entire image (entire image because contiguous is set to yes). All completely black pixels are now selected. And this means we have selected all the pixels, that are identical on both layers.
Now we invert the selection, so that it covers the non-identical (=different) pixels. We fill this selection with white, so all different pixels are now white.
[end of bottom line]
I always thought, that JPEG compression artefacts (at least for maximum quality JPEG images) concern only edges and areas in an image with high local contrast.
But I wouldn't expect large areas with a single color have its color changed in the course of the JPEG compression. Because if colors would change like this, then what is color management good for in JPEG files and why can an ICC profile be embedded in a JPEG file at all in this case if colors change anyway ?
It's funny, because the same results that make you say you might rethink using JPEGs let me find JPEGs a whole lot worse than I thought them to be anyway ...
Ramón, following the detailed steps above, were you able to reproduce the image I posted here ?
Mark, <br />>Ramón, following the detailed steps above, were you able to reproduce the image I posted here ? <br />http://www.imageboo.com/files/27yo13jqgnjssir7vfqk.png <br /> <br /> This is what I got: <br /> <br />c <a href="http://www.pixentral.com/show.php?picture=1kFuIZZvqsxOH7FrCGoLfVOnnyQU2" /></a> <img alt="Picture hosted by Pixentral" src="http://www.pixentral.com/hosted/1kFuIZZvqsxOH7FrCGoLfVOnnyQU2_thumb.jpg" border="0" /> <br /> <br /> For the sake of thoroughness, I'll confirm that I tried the very same exercise with a TIFF and a PSD saved from the same PNG, and after all going through all the steps with each, there were absolutely no different pixels.
Okay. Thanks for posting your results. It's good to see that on CS4 (as you said that's what you work on), the results are the same. It's basically the same picture I posted above.
So obviously the question is: What can we see from this picture?
The white pixels in the image show pixels that have changed during the conversion to JPEG. Two sort of differences can be seen:
1) We can see jpeg compression artefacts in the form of random white pixels around the letters and numbers and around hard edges, which is typical for JPEG compression and was expected.
2) We can see entire color patches in white, meaning that the color of the whole patch has changed during the JPEG conversion. This was - at least for me - an unexpected result.
If this turns out to be true, than JPEG does not only suffer from the typical JPEG artefacts, but also from overall inaccurate color rendition.
I hope an expert here can confirm or correct these findings.
Ramón, as I don't have CS4, could you maybe do me favour? Could you open this file http://img528.imageshack.us/img528/8885/fotoqb2.jpg in CS4 save it as BMP, zip it and upload the ZIP file somewhere (for example http://www.mediafire.com) ? I would be very thankful for that, Ramón!
And please make sure, that sRGB is used as color space when opening the jpeg file.
Here is a slightly related thread on this topic, if you are interested : http://www.adobeforums.com/webx/.59b726f1/0
Rats! I just lost a post I was typing. Grrr.
As I was saying, :), if you run your cursor in the BLACK rectangle as per step #7 above, over the areas where we know now that the pixels aren't quite black, you'll see values with minimal deviations por pure black, as I noted above in post #12 ( values like 0,0,1 or 1,0.1 or 1,0,0).
I am surprised that the variations in color rendition are that insignificantly small.
In any event, I'm glad I don't need JPEGs myself.
I'll go download your image now and save it as BMP as requested.
Yes, I'm using Photoshop 11 ("CS4").
Here's your BMP file saved in CS4:
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]
>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
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.
>This thread is about color management issues with JPEG-encoding.
I don't see the connection
... 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 ??
>And why are calibration targets available as jpeg files
NEVER came across one I would use myself!
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 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.
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.
> 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)
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))
That's why I still wonder why there are calibration targets in JPEG format, if JPEG colors cannot be trusted even for the highest quality JPEGs ???
I hear what you are saying, but I doubt most people would notice that small a difference. I guess if you were doing an A:B comparison, you might see some difference, but even that is questionable.
Take a series of perfectly neutral gray blocks of color (r=g=b), convert to high quality jpg (10-12 level) and see what happens. If you get some serious differences, I'm interested. Otherwise, it seems pointless for daily usage. People will continue using compression algorithms to make images sized for web and email use. Maybe one format is slightly better than the other, but I have heard no complaints regarding jpg format, except for the artifacts cause by too high a compression level. JPG is best used for continuous tone images (photographs). There are other formats better suited to illustrations and graphics that have large blocks of solid colors.
For the best print, press, lightjet and high end work, TIF and PSD are the way to go.
What exactly is the point of this exercise?
> Take a series of perfectly neutral gray blocks of color (r=g=b), convert to high quality jpg (10-12 level) and see what happens. If you get some serious differences, I'm interested.
I have no example handy, but if a pixel like (140, 107, 130) can suffer from JPEG compression, nothing suggests a gray pixel like (140, 140, 140) would somehow be exempted from JPEG compression.
> What exactly is the point of this exercise?
No offense, but you already asked that question. Is it illegitimate for me to simply wish to understand ?
> People will continue using compression algorithms to make images sized for web and email use.
Yes, but calibration targets have to be 100% accurate. So if it's really true, that colors in JPEG files cannot be accurate even at the highest quality level, than I ask myself why calibration targets exist in JPEG format.
Calibration targets in JPEG format are practically always compressed from the already existing TIFF or PSD original file.
Their existence is a useful clue to the low quality and low standards of whoever is offering or using them. In that sense, their existence does fulfill a useful purpose.
Another common use for such JPEG target files is to allow for a quick and dirty eyeball verification of the approximate state of calibration on things like laptop screens and inexpensive secondary palette monitors. JPEG deficiencies such as the one Mark has exposed would never be a factor in such rough and tumble eyeball exercises.
The JPEG format in those instances also allows for slow dialup connections.
I see. Thanks for pointing that out Ramón.
Just out of curiosity, what profile targets are being supplied as jpegs? Every one I've ever seen has been a zip compressed tiff, which, because of the nature of the color patches, compresses as much as most jpegs. There would no need for patch target files to be anything else. Even profile targets uprezzed for vendors who think they need 300 dpi for such things are still only a meg or two.
The stock imaging world seems to get along just fine on number 8 quality jpegs. That's what the vast majority of stock images are and you see them everywhere you look, in every newspaper and magazine you look at, both in editorial and advertising images. If there was any real problem with them aside from a jpeg artifact once in a while, you'd hear about it and maybe even see it. Small things you see while pixel peeping almost never are visible in print.
Thanks for your comments Peter Figen. I don't have a link handy right now, but I can post it here the next time one crosses my way.
Peter, reading your post, I'd say the bottom line of this thread is:
* When converting an image to JPEG there can be small color shifts even on very large areas, as demonstrated with the color patches turning white in post #2.
* Color management still makes sense, even for JPEG files, because it assures a relatively high color fidelity for quality-12-jpegs (although with slight color shifts compared to tiff)
* If a user would be...
... okay to accept the JPEG artefacts, because at the print resolution and with quality-12-jpegs the human eye can't see them anyway
... but not okay to accept (even slight) color shifts on large areas
==> this user would have to stick to lossless formats, for example tiff.