POV-Ray : Newsgroups : povray.advanced-users : Comparing colors specified by byte-value using POV-Ray rgb : Re: Comparing colors specified by byte-value using POV-Ray rgb Server Time
1 Jun 2024 10:51:21 EDT (-0400)
  Re: Comparing colors specified by byte-value using POV-Ray rgb  
From: Leroy
Date: 1 May 2024 14:15:00
Message: <web.6632853588fdbe378177b427f712fc00@news.povray.org>
When I was playing with palettes this is  what I use to gather the colors

#declare Imagemap=pigment{image_map{tga "EarthTopography.tga" gamma 1}}
#declare FnA = function {pigment {Imagemap scale<Imagewidth,Imageheight,1>}}

   a&b are integers 0<= a <Imagewidth 0<= b <Imageheight
    #declare FV=FnA(a,b,1);
    #declare C1=int(FV.x*255+.5);//red
    #declare C2=int(FV.y*255+.5);//green
    #declare C3=int(FV.z*255+.5);//blue

 These integers was used to sort colors into a 256 element palette.


  You may notice that I scale the image function very large and that I rounded
up the fraction that the function returned.

Hope this helps.

Have Fun!


Post a reply to this message

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