POV-Ray : Newsgroups : povray.pov4.discussion.general : Suggest v4.0 use rgbft floats for color image creation. (yuqk R17 v0.6.11.0) : Suggest v4.0 use rgbft floats for color image creation. (yuqk R17 v0.6.11.0) Server Time
21 Nov 2024 05:15:57 EST (-0500)
  Suggest v4.0 use rgbft floats for color image creation. (yuqk R17 v0.6.11.0)  
From: William F Pokorny
Date: 12 Nov 2024 02:51:09
Message: <673308ed@news.povray.org>
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'
colorimgfromfunctions_wintrps.png


 

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