Eric Brasseur writes about image processing errors, especially how most software mishandles gamma when scaling and blending images.
HN commenters link his gamma articles as examples of widespread software errors, and use them to argue for correct image downscaling and color spaces.
A tricky thing w/r/t browsers is that they are often really crappy at figuring out what color space a PNG image is supposed to be in. I think they often intentionally strip out the color space info from PNG images for the sake of helping PNG images blend smoothly into CSS / Flash / etc., for which they also don’t do correct color management. [The CSS spec says that colors should be interpreted as sRGB, but browsers don’t actually follow the spec.]
As a result of this problem, it’s difficult to judge whether image resizing specifically is being done incorrectly, or whether the image is just being interpreted incorrectly at any size.
You’ll notice if you open your first test image (http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png) in Apple’s Preview app, you get the correct behavior, but this is different from the behavior in Safari, for example, which shows something incorrect at every size. Stranger still, the behavior in Safari is roughly “correct” while resizing a browser window, but as soon as you let go of the mouse, it reverts to being incorrect.
There are multiple possible ways to embed color space info into PNG images, and the PNG spec is actually really terrible and confusing on this subject which results in lots of inconsistencies from one implementation to another. If I remember correctly some of them are treated better by browsers than others, but I’m not sure if there’s a way to encode images such that it will be handled properly everywhere (I mean,…
Hmm... I'm quite familiar with gamma correction. For those who are not, I recently did an "Explain Like I'm Five" http://www.reddit.com/r/explainlikeimfive/comments/1aeuyb/eli5_linear_workflow/c8xlj9i
But, my understanding is that for an image displayed 1-1 pixel-to-screen there is no intermediate math going on. So, there shouldn't be any opportunity for non-gamma-correct calculations to screw up the output.
Here's a nice example of non-gamma-correct browsers producing incorrect results after scaling an image: http://filmicgames.com/archives/354 also http://www.4p8.com/eric.brasseur/gamma.html But, in the SO question there is no scaling. So, I'm still confused about the difference in visual results between different applications directly displaying the image...
127,127,127 feels dark. The explanation is in the article:
http://www.4p8.com/eric.brasseur/gamma.html#explanation
Basically, if you have a test image which consists of alternating black and white, it should have the same perceived brightness when you scale it down - but when you scale it down, the software needs to average out the black and white. If it does a simple arithmetic average, it'll probably choose 127,127,127 once it's downscaled enough to become uniform in color. But if you compare that uniform color with the original black and white lines, it looks a different shade - a darker shade. That's because 127,127,127 isn't 50% grey, it's not in the middle between black and white.
The article has further explanation.
Enough has been said about incorrect gamma (this and [0]), now I think it's high time to bash the software of the world for incorrect downscaling (e.g. [1]). It has much more visible effects, and has real consequences for computer vision algorithms.
In the course on computer vision in my university (which I help teaching) we teach this stuff to make students understand physics, but at the end of the lecture I'd always note that for vision it's largely irrelevant and isn't worth the cycles to convert image to the linear scale.
[0] http://www.4p8.com/eric.brasseur/gamma.html
[1] http://photo.stackexchange.com/questions/53820/why-do-photos-of-digital-screens-turn-out-the-way-they-do
I use and love it, but I sincerely wish they'd change the name and the UI. I'm a programmer, but even I didn't realize how much they were hiding in context menus at first until I had to search online to find documentation on how to do the few simple things I can do.
The multi-window thing I really don't have much of a problem with, though, even if it was hard to get used to at first. I don't have much use for the higher bit depths and such, but I can see his point about quality and why others need it.
Incidentally, a lot of programs have problems with gamma. I think this link has been on HN a few times: http://www.4p8.com/eric.brasseur/gamma.html
I know that this is an introduction, but I wish there was a warning about the use of improper color spaces for different tasks (like using sRGB or any nonlinear colorspace for downscaling images, blurring or Phong shading). A warning about the existence of different colorspaces and their different use cases would be enough in an introductionary write up. It's still an issue in most of today's software [1].
Like open this image in your browser or in your favorite image viewer and scale it down to 50%:
http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png
[1] http://www.4p8.com/eric.brasseur/gamma.html