|
![](/i/fill.gif) |
In article <4vnrju8p4dnopfhb4ckuc4narsdevjg2j5@4ax.com>,
Peter Popov <pet### [at] vip bg> wrote:
> >(you render in a 48 bits PNG, you use it as an image_map
> > that fits exactly the screen, and you process it using
> > eval_pigment and reconsturct the image with colored
> > boxes)
>
> I'd rather use a function pigment for that - much faster than parsing
> a gazillion boxes.
That's a good idea...you could do the same thing as the post_process
curves filter without needing the patch, though it would still have the
limitations of what you can put through a PNG file. A image_map pigment
function run through three spline functions and combined into the final
image with an average pigment would do the trick:
#declare imgFn = function {pigment {image_map {...}}}
#declare rCurveFn = function {spline {...}}
#declare gCurveFn = function {spline {...}}
#declare bCurveFn = function {spline {...}}
...
pigment {average
pigment_map {
[pigment {function {rCurveFn(imgFn(x, y, z).red).x}
color_map {[0 rgb 0][1 rgb < 3, 0, 0>]}}]
[pigment {function {gCurveFn(imgFn(x, y, z).green).x}
color_map {[0 rgb 0][1 rgb < 0, 3, 0>]}}]
[pigment {function {bCurveFn(imgFn(x, y, z).blue).x}
color_map {[0 rgb 0][1 rgb < 0, 0, 3>]}}]
}
}
I used three splines here to make it easier to adjust each channel
separately, since splines use vectors you should be able to use just one
spline. You could also do things like use a spline value to scale the
color according to the brightness of the color.
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |