POV-Ray : Newsgroups : povray.newusers : Color Generation: How do I get rid of pink. : Re: Color Generation: How do I get rid of pink. Server Time
4 Nov 2024 17:30:18 EST (-0500)
  Re: Color Generation: How do I get rid of pink.  
From: oldmicah
Date: 13 Jul 2003 20:15:00
Message: <web.3f11f581fe91850d9cfc34200@news.povray.org>
Hello Tim, Micha, and Christopher

  Tim, I was thinking about your solution.  The advantage is that I could
gracefully block out ranges along one color axis.  Unfortunately, the
'pinks' I'm concerned about are multi dimensional.  i.e. a certain range of
red is only invalid with certain range of blue and green.  One possibility
is to alter your code to return pointers to other tables in the case of
possible ppv's (possible pink values).  i.e. if the red value is 200-255, I
get an index to the green danger zone table which, if it checks out, I need
to check the appropriate blue table.  (Apologies if I misunderstood)
Basically, I'd be  trying to model 3 dimensional (1 axis for red, green,
and blue) blobs of invalid color areas.  If my point in rgb space was in
the ppv zone, I'd grab another random color until I succeeded.  A lot of
work.

  The big plus side is that after many years of playing with computer
graphics, thinking about your linear color space has helped me finally
internalized the concept of color spaces.

  With what Micha just mentioned, I went back and started playing with my
color table again, this time looking at hsv instead of rgb.  It looks like
if I block out hues 277 to 400, I miss almost all of the undesirable
colors.

  What is bizarre is that my first couple of attempts at limiting the Hue to
less than .68 produced almost exclusive annoying colors.  (.68 = 277/400; a
hue of 277-400 in Photoshop's HSB color sampler produced the undesirable
colors.) I had to invert hue by forcing it to be greater than .32 to lose
the colors.  Is this a bug, or am I confused?

 #macro GetBookColor (  )
 #local temphsvcolor=color <0, 0, 0>;
 #while( temphsvcolor.red < .32 )
  #declare newbookcolor=color red (.5*rand(R2R))
                           green (.5*rand(R2R)) blue (.5*rand(R2R));
  #local temphsvcolor=CRGB2HSV( newbookcolor );
 #end
#end

  Bottom line is that it all works now, and I really appreciate everyone's
help on this.  (Non-pink version is at
http://homepage.mac.com/sstrange/POV/libraryatnight.jpg )

many thanks,
Steven

Micha Riser wrote:
>I think if you use a different colour space that rgb, that ist the HSV
>colour space, this should easily be possible. Just limit the H-value to the
>non-pink colours. I think there are somewhere macros availabale that
>convert HSV2RGB for POV-Ray.
>
>- Micha
>
>POV-Ray Objects Collection: http://objects.povworld.org
>


Post a reply to this message

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