POV-Ray : Newsgroups : povray.advanced-users : vlength( ) : Re: vlength( ) Server Time
30 Jul 2024 08:14:41 EDT (-0400)
  Re: vlength( )  
From: SamuelT
Date: 13 Jun 2000 13:14:09
Message: <39466CB5.8A7BD9A9@aol.com>
Well, this simple macro seems to be working. It is a combination of your idea and
Ron's pasted code.

#macro Lum( Color )
 Color.x*.3
 +Color.y*.59
 +Color.z*.11
#end

Funny thing, Photoshop's desaturation seems to be goofy. It gives unexpected
results, although the desaturation tool itself seems to be fine.


Warp wrote:

> SamuelT <STB### [at] aolcom> wrote:
> : It's for the eval_pigment stuff I've been using. I needed to convert a color
> : vector into a float value so I could use it for elevation.
>
>   So in practice what you are trying to do is to convert a color to b/w
> (ie. a brightness value).
>   There's an exact formula on how each color component affects the brightness,
> and I don't remember exactly the values, but this might be a good
> approximation:
>
> brightness = red*0.25 + green*0.6 + blue*0.15
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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