 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hi,
I saw in a message from Peter Popov in reply to Feature request for
pov3.5 (08/09/00 16:55), that rgb can be converted to spectra. That's
what I need., since I want to convert the rgb value to a corresponding
audio frequentie, and audio is spectra. Where can I find more
information on doing so? (I'm a newbie on complex math, so it should be
a little bit easy explained.)
Remco Poelstra
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Remco Poelstra wrote:
>
> Hi,
>
> I saw in a message from Peter Popov in reply to Feature request for
> pov3.5 (08/09/00 16:55), that rgb can be converted to spectra. That's
> what I need., since I want to convert the rgb value to a corresponding
> audio frequentie, and audio is spectra. Where can I find more
> information on doing so? (I'm a newbie on complex math, so it should be
> a little bit easy explained.)
>
> Remco Poelstra
I don't think that you'll need complex math for this. In MegaPov source
code there is function (RGBtoHue in color.c)from MSGTracer, which
converts RGB to visible spectra (although part of it is commented out,
but You can get idea). Basically you should convert RGB to hue, then
convert hue to frequency (or wave length).
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Vahur Krouverk wrote:
>
> Remco Poelstra wrote:
> >
> > Hi,
> >
> > I saw in a message from Peter Popov in reply to Feature request for
> > pov3.5 (08/09/00 16:55), that rgb can be converted to spectra. That's
> > what I need., since I want to convert the rgb value to a corresponding
> > audio frequentie, and audio is spectra. Where can I find more
> > information on doing so? (I'm a newbie on complex math, so it should be
> > a little bit easy explained.)
> >
> > Remco Poelstra
>
> I don't think that you'll need complex math for this. In MegaPov source
> code there is function (RGBtoHue in color.c)from MSGTracer, which
> converts RGB to visible spectra (although part of it is commented out,
> but You can get idea). Basically you should convert RGB to hue, then
> convert hue to frequency (or wave length).
All right, I'll, but what is hue exactly? I thought it's the 'rotation'
of the colorcircle.
Remco
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <39A192D3.9659E6D5@home.nl>, Remco Poelstra
<rjp### [at] home nl> wrote:
> I saw in a message from Peter Popov in reply to Feature request for
> pov3.5 (08/09/00 16:55), that rgb can be converted to spectra. That's
> what I need., since I want to convert the rgb value to a corresponding
> audio frequentie, and audio is spectra. Where can I find more
> information on doing so? (I'm a newbie on complex math, so it should be
> a little bit easy explained.)
I think it would be very useful to have rgb2hls() and hls2rgb()
functions, and similar ones for HSV and other color spaces. These could
also be useful post_process filters. The only thing stopping me from
writing them is a lack of knowledge of how to convert between them.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Mon, 21 Aug 2000 11:42:03 -0500, Chris Huff wrote:
>I think it would be very useful to have rgb2hls() and hls2rgb()
>functions, and similar ones for HSV and other color spaces. These could
>also be useful post_process filters. The only thing stopping me from
>writing them is a lack of knowledge of how to convert between them.
The PostScript Language Reference Manual contains the necessary formulae,
and is available in PDF format from Adobe's website. It also might
include some CMYK conversions, though I'm undecided as to the usefulness
of those.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <slr### [at] fwi com>, ron### [at] povray org
wrote:
> The PostScript Language Reference Manual contains the necessary formulae,
> and is available in PDF format from Adobe's website. It also might
> include some CMYK conversions, though I'm undecided as to the usefulness
> of those.
Thanks for the information! I will check it out...
I tend to agree about the CMYK, it is just too dependant on output
devices. However, a simple conversion might still be useful, if the
documentation warns about the fact it isn't very accurate. The problem
is, where do we put the K? The other color spaces could be stored in the
same rgb vectors, the components would just have different meanings.
Maybe the function should optionally take a float vector which it would
store the K value in.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chris Huff wrote:
> I think it would be very useful to have rgb2hls() and hls2rgb()
> functions, and similar ones for HSV and other color spaces. These could
> also be useful post_process filters. The only thing stopping me from
> writing them is a lack of knowledge of how to convert between them.
I wrote a macro to do RGB<->HLS...
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
Please visit my website: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <39A1A7FA.53ED54C8@faricy.net>, David Fontaine
<dav### [at] faricy net> wrote:
> I wrote a macro to do RGB<->HLS...
And I have it on my system. :-)
I just haven't reverse engineered it and written a POV conversion
function yet. And it only takes care of one color space.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Psuedocode plagerized from Computer Graphics and Principals 2nd Edition:
procedure RGB_To_HSV( r, g b: real; var h,s v : real)
begin
max := Maximum(r,g,b);
min := Minimum(r,g,b);
v := max;
if max <> 0 then
s := (max - min)/max;
else s := 0;
if s = 0 then
h := UNDEFINED
else
begin
delta := max - min;
if r = max then
h := (g - b)/delta;
else if g = max then
h := 2 + (b - r)/delta;
else if b = max then
h := 4 + (r - g)/delta;
h := h* 60;
if h < 0 then
h := h + 360;
end
end
This should be easily converted into a macro (assumming I haven't made too
many typing errors.)
"Ron Parker" <ron### [at] povray org> wrote in message
news:slr### [at] fwi com...
> On Mon, 21 Aug 2000 11:42:03 -0500, Chris Huff wrote:
> >I think it would be very useful to have rgb2hls() and hls2rgb()
> >functions, and similar ones for HSV and other color spaces. These could
> >also be useful post_process filters. The only thing stopping me from
> >writing them is a lack of knowledge of how to convert between them.
>
> The PostScript Language Reference Manual contains the necessary formulae,
> and is available in PDF format from Adobe's website. It also might
> include some CMYK conversions, though I'm undecided as to the usefulness
> of those.
>
> --
> Ron Parker http://www2.fwi.com/~parkerr/traces.html
> My opinions. Mine. Not anyone else's.
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <39a1d84c@news.povray.org>, "Halbert" <hha### [at] capital net>
wrote:
> Psuedocode plagerized from Computer Graphics and Principals 2nd Edition:
...snip...
> This should be easily converted into a macro (assumming I haven't
> made too many typing errors.)
Whee, Pascal...the last time I read Pascal I was trying to convert a
demo program written in it to C. It was surprisingly easy, actually...
Here is an untested attempt at a straight conversion to POV:
#macro RGB2HSV(RGB)
#local Max = max(RGB.r, max(RGB.g, RGB.b));
#local Min = min(RGB.r, min(RGB.g, RGB.b));
#local V = Max;
#if(Max != 0)
#local S = (Max - Min)/Max;
#else
#local S = 0;
#end
#if(S = 0)
#local H = 0;
#else
#local Delta = Max - Min;
#if(RGB.r = Max)
#local H = (RGB.g - RGB.b)/Delta;
#else
#if(RGB.g = Max)
#local H = 2 + (RGB.b - RGB.r)/Delta;
#else
#if(RGB.b = Max)
#local H = 4 + (RGB.r - RGB.g)/Delta;
#end
#end
#end
#local H = H*60;
#if(H < 0)
#local H = H + 360;
#end
#end
(< H, S, V>)
#end
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chris Huff wrote:
> In article <39A1A7FA.53ED54C8@faricy.net>, David Fontaine
> <dav### [at] faricy net> wrote:
>
> > I wrote a macro to do RGB<->HLS...
>
> And I have it on my system. :-)
> I just haven't reverse engineered it and written a POV conversion
> function yet. And it only takes care of one color space.
I know... The only others I know of are CMYK and spectra, what is HSV?
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
Please visit my website: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
David Fontaine wrote:
> I know... The only others I know of are CMYK and spectra, what is HSV?
http://www.inforamp.net/~poynton/Poynton-colour.html
--
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chris Huff wrote:
>
> In article <39A1A7FA.53ED54C8@faricy.net>, David Fontaine
> <dav### [at] faricy net> wrote:
>
> > I wrote a macro to do RGB<->HLS...
>
> And I have it on my system. :-)
> I just haven't reverse engineered it and written a POV conversion
> function yet. And it only takes care of one color space.
>
> --
> Christopher James Huff
I've written conversion between RGB and HSV, HSL XYZ, xyY, YIQ color
spaces as C function in colour.c. (I've not tested it very much, hope I
haven't made too much mistakes in entering marrix constants). If someone
wants to add coversion support for POV-Ray language, then I can send
source code.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken wrote:
> David Fontaine wrote:
>
> > I know... The only others I know of are CMYK and spectra, what is HSV?
>
> http://www.inforamp.net/~poynton/Poynton-colour.html
>
> --
> Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Man, a person could spend their entire life studying color! I looked in my
encyclopedia too and found several pages on the Purkinje shift and
Bezold-Brucke effect, simultaneous and successive chromatic adaption,
tristimulus, etc, even the human brain's adjustments in percieved color and
color psychology...
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
Please visit my website: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <39A2221F.B8F2E0D2@aetec.ee>, Vahur Krouverk
<vah### [at] aetec ee> wrote:
> I've written conversion between RGB and HSV, HSL XYZ, xyY, YIQ color
> spaces as C function in colour.c. (I've not tested it very much, hope I
> haven't made too much mistakes in entering marrix constants). If someone
> wants to add coversion support for POV-Ray language, then I can send
> source code.
Sounds interesting...could you post the conversion functions to
povray.programming or povray.binaries.programming?
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Go to my raytracing page at:
http://www.crosswinds.net/~robertsc/raytrac2.htm . I have a link
for converting from RGB to spectra there.
Remco Poelstra wrote:
>
> Hi,
>
> I saw in a message from Peter Popov in reply to Feature request for
> pov3.5 (08/09/00 16:55), that rgb can be converted to spectra. That's
> what I need., since I want to convert the rgb value to a corresponding
> audio frequentie, and audio is spectra. Where can I find more
> information on doing so? (I'm a newbie on complex math, so it should be
> a little bit easy explained.)
>
> Remco Poelstra
--
See my Free stuff page. It compares free website providers, and
lists free internet access providers.
http://www.crosswinds.net/~robertsc/free.htm
Win98 help file loaded with hints and tips, including securing a
Win 95/98 PC in a classroom setting. VB4 help file with lots of
code and hints.
At http://www.crosswinds.net/~robertsc/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chris Huff wrote:
>
> In article <39A2221F.B8F2E0D2@aetec.ee>, Vahur Krouverk
> <vah### [at] aetec ee> wrote:
>
> > I've written conversion between RGB and HSV, HSL XYZ, xyY, YIQ color
> > spaces as C function in colour.c. (I've not tested it very much, hope I
> > haven't made too much mistakes in entering marrix constants). If someone
> > wants to add coversion support for POV-Ray language, then I can send
> > source code.
>
> Sounds interesting...could you post the conversion functions to
> povray.programming or povray.binaries.programming?
>
Ok, I'll do it after I complete this message.
povray.binaries.programming will be the group. I've made tests for
ensuring their correctness and I believe, that HSV, HSL and YIQ
conversions are correct (at least BMRT gave same output). Hopefully XYZ
and xyY are correct too, as they involve only matrix multiplication.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <39A62132.B898A45A@aetec.ee>, Vahur Krouverk
<vah### [at] aetec ee> wrote:
> Ok, I'll do it after I complete this message.
> povray.binaries.programming will be the group. I've made tests for
> ensuring their correctness and I believe, that HSV, HSL and YIQ
> conversions are correct (at least BMRT gave same output). Hopefully XYZ
> and xyY are correct too, as they involve only matrix multiplication.
I downloaded it and will take a look at these. It would also help if you
had a link to pages explaining what they *are*, but I can probably find
that somewhere myself...do the XYZ and xyZ ones use a color matrix
similar to my post_process filter?
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Remco Poelstra wrote:
>
> All right, I'll, but what is hue exactly? I thought it's the 'rotation'
> of the colorcircle.
You're right. And as the rotation (or angle) in the colorcircle it
corresponds directly to frequency.
Markus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |