Gamma error in picture scaling (2007)
4p8.com
4p8.com
For most images & kernels, you can get by with doing math in about 31 bits total precision (a bit for underflow clamping), so that's the magic speed improvement from ignoring gamma on old 32-bit architectures.
If you gamma-correct, your sources will need to be 10-12 bpc after transformation, and you'll need >32 bits of integer precision for large kernels. Even though x86 has a 32x32 -> 32bit high word multiply, this all gets a lot better on x64.
So basically: today on 64-bit machines (or wide SIMD) you could do gamma-correct resampling a whole lot cheaper than you could do 10 years ago.
[edit] In the end you notice the difference with line art, but for most photographs you want to spend spend your CPU budget on sharpness (by using wider kernels).
What are you doing now? Picasa hasn't changed much since Google bought it and ignored it (except for adding G+ integration)
Curiously, even after all those annoying update popups, this photography viewer app still does not support retina displays.
http://krazydad.com/blog/2013/12/05/emergent-orange/
(Emergent Orange made to front page here on HN yesterday. However, this gamma article says the movie industry gets gamma scaling right, and KrazyDad's day job is for Disney iirc.)
[1] Wyszecki, Stiles: Color science
You might say my priorities are wrong and GIMP is short on developers and I care about infrastructure more than something like gamma. But I'm moving to Wayland soon, and if GIMP has to run with GTK2 via XWayland I'm just not going to install it. OTOH I'm not a major user of it.
Link: http://www.eyetap.org/papers/docs/comparametric.pdf
The section, starting on PDF page 4, is called "On the Value of Doing the Exact Opposite of What Stockham Advocated", and describes exactly both this problem, and the solution.
Reference rendering and SVG: http://www.w3.org/Graphics/SVG/Test/20061213/htmlEmbedHarnes...
You can see that in Firefox the SVG has much darker colors.
$ convert lama.jpg -gamma .45455 -resize '50%' -gamma 2.2 slama.jpgTo this point, ImageMagick has built in understanding of colorspaces:
convert lama.jpg -colorspace RGB -resize '50%' -colorspace sRGB slama.jpg
In English: Read lama.jpg, convert it to a linear RGB colorspace, rescale to 50%, convert it to sRGB, write to slama.jpgThis is apparently also covered in the article, more as an aside, but it should be the first and foremost way to do it with ImageMagick.
And f1 and f2 don't need to be close to Nyquist, as long as they're significantly attenuated by the downsampling filter.
Software which work in full-float linear (Nuke, for example) don't have this issue, as the RGB values are already in luminance-adjusted values as they're linear.
The issue only affects software filtering images in lower-precision (and thus gamma-baked) pixel intensity values - i.e. 0-255 for uchar (8-bit) and 0- for ushort (16-bit), where the R,G and B channels are given equal weighting).
He's also being a tad disingenuous. Early in the article, he calls out Photoshop as an offender, but Photoshop has multiple image reduction algorithms that it can use. I haven't used the Gimp in a while, but I'm pretty sure it does, too. Yet it's not until nearly the end of the article that he mentions Photoshop is capable of doing a correct job.
>> "On the other hand, there never was a gamma problem within the printing or the movie industry. They have defined tight and scientifically-grounded standards and procedures and they perceive the public software tools as toys."
This line gave me the impression the article was written by a disgruntled analog-era print or movie industry employee, probably someone who wasn't the best in the world but was employed at the "peak", who is upset about their growing lack of relevance and is foisting the blame on "stupid consumers" and "non professionals". You see the same thing with old line-of-business-application Java programmers. The key is it's not the specific technology that is the problem, it's the relative mediocrity of the writer.
If you argue from a craftsman perspective, but come off as bitter, unemployed greybeard, then you probably weren't ever as good as you seem to think you are. The car didn't kill the horse whip industry, by evidence that one can still buy horse whips. It killed the cheap, commodity horse whip industry.
>> "Knowing that difference, even if you wouldn't notice it, do you accept it?"
Yes, because itty, bitty photos of dragonflies on my cellphone don't mean anything of monetary value to me. For all his grandstanding about professionalism, who is using such tiny, crappy images for work?