|
|
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
|
|