Re: [Algorithms] Common Src/DestAlphaBlend mode combinations
Brought to you by:
vexxed72
From: Alen L. <ale...@cr...> - 2008-12-06 12:04:13
|
Saturday, December 6, 2008, 1:12:17 AM, Wessam wrote: >> The last time I checked (CS2?), an option for linear space operation was available only for some operations >> (image resizing?), but not for general blending, and was in some obscure place in the prefs. > It’s been in Photoshop a while ago. Edit >> Color Settings > (Check) Advanced Mode > (Check) Blend RGB Colors Using Gamma. > It affects all transparency blends (including layer transparencies). Sorry, my bad. Yes that's the option. I've misremembered the way it works. It applies to blending, but it curiously doesn't apply to image resizing. I remember it seemed strange, because resizing is the textbook example of how operating in gamma space can produce wrong results: #1 Create an image filled with pixel-wide black/white stripe pattern. #2 Downscale it 2x2 using bilinear filtering. #3 Upscale it back. #4 Compare it visually with the original when viewed from a distance. If resampling was done in gamma space, the result will _much_ darker than the original. When I was trying to demonstrate this kind of artefact to our artists, I was expecting that I would be able to demonstrate how Photoshop is able to do the resizing correctly if the color settings are right, but alas.... To do a correct image resize in PS, one has to do strange tricks with converting the image to linear color using the levels dialog (a strange place for a gamma conversion tool, isn't it?), then resize, then go back to gamma space. And this has to be done with 16-bit per component precision of course. In the end it is really complicated, so I gave up and let our artists continue to do image resizing the wrong way. Sadly, Gimp seems to follow the stray path of PS, and even the gamma conversion is placed in the same dialog, etc. :( If you know of a way to do resizing correctly in PS, please do let me know! Cheers, Alen |