Re: Linear Colorspace

Bob Friesenhahn <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
On Wed, 2 Dec 2015, Sam Wilson wrote:
>> What do you mean by "Linear Colorspace"?  What are you actually trying
>> to accomplish?
> I'd like to get a colorspace with 1.0 gamma, I think. If you try to
> scale the image I linked down by 50% without converting the colorspace,
> you'll end up with a grey box. I'd like that not to happen.

Use:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   image.gamma(0.454545);  // 1/2.2
   [ do something ]
   image.gamma(2.2);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> Fairly sure I mean linear light. I'm just getting into the graphics
> world, so please forgive any obvious mistakes on my part. There's an
> article that describes the problem I'm seeing here:
> http://www.4p8.com/eric.brasseur/gamma.html

The above should accomplish what the article recommends.  Keep in mind 
that whenever you apply a gamma correction change, the image is 
subject to quantization error (new value is subject to the number of 
discrete levels available).  The quantization error will be reduced by 
using a Q:16 build.

There are factors other than gamma to consider such as the colorspace 
used.  This is a reason why there is a note in the documentation for 
-colors which says:

"Empirical evidence suggests that distances in color spaces such as 
YUV or YIQ correspond to perceptual color differences more closely 
than do distances in RGB space.  These color spaces may give better 
results when color reducing an image."

The same issues apply to resize and any other operations which blend 
pixels.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.