|
|
In early 2023 I posted on creating internal greyscale image_maps from a
function. See:
https://news.povray.org/povray.binaries.images/thread/%3C63ee37a8%241%40news.povray.org%3E/
Well... It's also possible to create color image_maps this way. However,
the long standing set up in official releases of POV-Ray was to store
the results in a 16 bit, positive value only, internal image format. In
the next release of the yuqk fork (R17) the internal format for color
images is now rgbft, 32 bit floats.
As a way to look at how the available image_map interpolations work at
the pixel level in the attached image, I used the following code for the
pigment:
#declare P00 = pigment {
image_map {
function 20 20 {
pigment {
user_defined {
function { f_popnrm_rnoise(x,y,z,e *1e5,1) },
function { f_popnrm_rnoise(x,y,z,pi *1e5,1) },
function { f_popnrm_rnoise(x,y,z,tau*1e5,1) },
function { 0 },
function { 0 }
}
}
once
//interpolate 0 // No interpolation. Upper left
//interpolate 2 // Bi-Linear. Upper right
//interpolate 3 // Bi-Cubic. Lower left
interpolate 4 // Normalized distance. Lower right
}
translate <-0.5,-0.5,0>
scale <e,e,1>
}
Note. We are storing negative channel values in the image_map. This more
or less where the stored image goes black due clipping to 0.0 channel
values on output (to most formats).
If instead of f_popnrm_rnoise() for the color channels, we use functions
based on an incoming image, we can do image processing /
post-processing. For example, a quick blur can be had with just:
...
function IMAGE_WIDTH/2 IMAGE_HEIGHT/2 ...
...
interpolate 3
...
Bill P.
Post a reply to this message
Attachments:
Download 'colorimgfromfunctions_wintrps.png' (512 KB)
Preview of image 'colorimgfromfunctions_wintrps.png'
|
|