POV-Ray : Newsgroups : povray.off-topic : Colorspaces. Server Time
7 Sep 2024 03:19:59 EDT (-0400)
  Colorspaces. (Message 1 to 5 of 5)  
From: Mike Raiford
Subject: Colorspaces.
Date: 21 Jul 2008 13:18:37
Message: <4884c4ed$1@news.povray.org>
Remember me mentioning the color matrix feature of GDI+

Experimenting and playing with the feature has given me some really good 
insight.

http://www.pfk.ff.vu.lt/cie/1931CIE_explanation.htm

Talks about conversion to the CIE XYZ colorspace. The numbers in the 
matrix were strange and mysterious to me. (Not only that, but uhg to do 
the conversion I have to use matrix arithmetic. I used to hate doing 
matrix multiplication simply because I'd get confused. I know, I know.) 
anyway ... onward.

Those mystery numbers are actually the values that determine the make up 
of the resulting channels so, in the example of XYZ -> RGB R is actually 
made up of 0.412453 X, 0.357580 Y, 0.180423 Z ... its actually really 
simple!

You can also do weird things with color matricies such as rotate the 
colors along an axis, etc ... much as you can do with points. You can 
also, of course use these matricies to convert a color from one RGB 
profile to another (i.e. from sGRB to AdobeRGB) I'm considering taking a 
close look at rotation to see what I can do, I'm thinking along the 
right axis you can do hue and saturation shifts. :D


Post a reply to this message

From: Mike Raiford
Subject: Re: Colorspaces.
Date: 21 Jul 2008 13:27:26
Message: <4884c6fe$1@news.povray.org>
Mike Raiford wrote:

> of the resulting channels so, in the example of XYZ -> RGB R is actually 
> made up of 0.412453 X, 0.357580 Y, 0.180423 Z ... its actually really 
> simple!

Oops, and it's even easier to get backwards.

Convert RGB -> XYZ ... X is actually made up of 0.412453 R, 0.357580 G, 
0.180423 B


Post a reply to this message

From: scott
Subject: Re: Colorspaces.
Date: 22 Jul 2008 03:44:57
Message: <48858ff9$1@news.povray.org>
> Those mystery numbers are actually the values that determine the make up 
> of the resulting channels so, in the example of XYZ -> RGB R is actually 
> made up of 0.412453 X, 0.357580 Y, 0.180423 Z ... its actually really 
> simple!

Yep, that's all matrix multiplication is, just a compact way of writing out 
those 3 equations of 3 variables :-)

BTW, the mappings that you can do by a matrix only convert to/from *linear* 
RGB.  When you show them on a display you need to gamma correct them (or if 
you get a bitmap from somewhere, you need to undo the gamma first before 
conversion).

> I'm thinking along the right axis you can do hue and saturation shifts. :D

Yup, look at the xy chromaticity diagram on that link, it should be easy to 
see geometrically what you need to do in order to get those shifts.


Post a reply to this message

From: John VanSickle
Subject: Re: Colorspaces.
Date: 22 Jul 2008 07:37:18
Message: <4885c66e@news.povray.org>
scott wrote:
>> Those mystery numbers are actually the values that determine the make 
>> up of the resulting channels so, in the example of XYZ -> RGB R is 
>> actually made up of 0.412453 X, 0.357580 Y, 0.180423 Z ... its 
>> actually really simple!
> 
> Yep, that's all matrix multiplication is, just a compact way of writing 
> out those 3 equations of 3 variables :-)
> 
> BTW, the mappings that you can do by a matrix only convert to/from 
> *linear* RGB.  When you show them on a display you need to gamma correct 
> them (or if you get a bitmap from somewhere, you need to undo the gamma 
> first before conversion).

And components in some schemes can't be derived as a linear combination 
of values from another scheme.  Hue, for instance.  A line parallel to 
the H axis in an HSV color scheme does not map to a straight line in RGB.

Regards,
John


Post a reply to this message

From: Invisible
Subject: Re: Colorspaces.
Date: 22 Jul 2008 07:53:04
Message: <4885ca20$1@news.povray.org>
John VanSickle wrote:

> And components in some schemes can't be derived as a linear combination 
> of values from another scheme.  Hue, for instance.  A line parallel to 
> the H axis in an HSV color scheme does not map to a straight line in RGB.

Damn you and your nonlinear colourspace transformations! What about 
Dibble and Grubb?

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.