POV-Ray : Newsgroups : povray.general : Modifying an image_map color? : Re: Modifying an image_map color? Server Time
30 Jul 2024 04:21:01 EDT (-0400)
  Re: Modifying an image_map color?  
From: Christian Froeschlin
Date: 14 Oct 2009 14:51:56
Message: <4ad61dcc$1@news.povray.org>
CShake wrote:

> Is there any way to do this in povray, without having to manually edit 
> the .tga files in gimp/photoshop?

You can convert between pigments and functions, which should allow
you to do arbitrary color transformations on an image_map, e.g.

#macro from_black(COLOR)
color_map
{
   [0 color rgb 0]
   [1 color COLOR]
}
#end

#macro pigment_scale(PIGMENT, SCALE)
#local F = function { pigment {PIGMENT} }
#local R = pigment {function {F(x,y,z).red}   from_black(3*SCALE*Red)  }
#local G = pigment {function {F(x,y,z).green} from_black(3*SCALE*Green)}
#local B = pigment {function {F(x,y,z).blue}  from_black(3*SCALE*Blue) }
pigment {average pigment_map {[R] [G] [B]} }
#end


Post a reply to this message

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