News for hackers. Stuff that matters.
Re:Widespread gamma error in image scaling algorithms (2007) by jmillikin on Monday February 22, 2010 @12:02AM (#1141986)
Although the article is dated 2007, the error it describes is still present in every implementation I've tested. There's a test page for browsers at:

http://www.4p8.com/eric.brasseur/gamma_dalai_lama.html

Re:Widespread gamma error in image scaling algorithms (2007) by _delirium on Monday February 22, 2010 @01:29AM (#1142085)
Are projects like Gimp and ImageMagick not yet aware of it, don't consider it a bug, just haven't gotten around to fixing it, or what? In some brief trawling through bugtrackers and mailing lists I haven't been able to find any discussion on the subject, but it's somewhat hard to search on variations of the widely used terms "gamma", "scaling", and "bug".
Re:Widespread gamma error in image scaling algorithms (2007) by petewarden on Monday February 22, 2010 @01:46AM (#1142116)
Part of the issue is that people have been trained by two decades of Photoshop and expect the results of the 8-bit algorithms. Gaussian blur for example looks very different in linear light, with light areas of the image blooming out over the darker. If you've spent years working with the 8 bit gamma space algorithms, that's a bug. Instead, I've ended up implementing both algorithms, usually with the more correct one labeled as 'defocus' or 'camera blur'.

Rescaling and in general resampling is a lot simpler. These days it's pretty inexcusable not to do it in linear space. Here's my own exploration of that problem from a couple of years back:

http://petewarden.typepad.com/searchbrowser/2008/08/why-font...

Re:Widespread gamma error in image scaling algorithms (2007) by jacobolus on Monday February 22, 2010 @03:10AM (#1142236)
Because human visual response is non-linear, doing operations like gaussian blur (which is an artificial operation, unrelated to physical phenomena) in linear light space isn’t “more correct” in any absolute sense. Calling a gaussian blur “camera blur” or “defocus” (whatever the color space) is just inaccurate and confusing.

Compositing and interpolating should definitely be done in linear space though.

Re:Widespread gamma error in image scaling algorithms (2007) by petewarden on Monday February 22, 2010 @03:17AM (#1142248)
> Calling a gaussian blur “camera blur” or “defocus” (whatever the color space) is just inaccurate and confusing.

Nonsense. When you defocus a camera, you get an effect that's comparable with a gaussian blur performed in linear space. Blurring is a well-understood operation that's existed for a long time in the analog world, before we ever did any digital processing.

Re:Widespread gamma error in image scaling algorithms (2007) by jacobolus on Monday February 22, 2010 @03:30AM (#1142269)
Well, “comparable” insofar as you don’t care about the details, I suppose; you could also call a square or triangle blur kernel “defocus” if you wanted.

A real lens blur doesn’t look much like a gaussian blur for someone who is familiar with both and paying attention.

For explanation, see for instance http://en.wikipedia.org/wiki/Bokeh

Re:Widespread gamma error in image scaling algorithms (2007) by petewarden on Monday February 22, 2010 @10:07AM (#1142793)
Yep, my 'camera defocus' also included arbitrary kernel geometry as an option! I'm not trying to be obnoxious about this, but I really did spend five years of my life coding this stuff for Apple.
Re:Widespread gamma error in image scaling algorithms (2007) by scythe on Monday February 22, 2010 @05:02AM (#1142356)
>human visual response is non-linear

Human visual response to color is also nonlocal, which has an array of interesting effects.

Re:Widespread gamma error in image scaling algorithms (2007) by jacobolus on Monday February 22, 2010 @03:28AM (#1142268)
You can make ImageMagick do quite sophisticated image interpolation, if you want.

Pretty sure GIMP’s main goal is to just do what Photoshop does.