POV-Ray : Newsgroups : povray.general : Changing image maps' transparency? : Re: Changing image maps' transparency? Server Time
30 Jul 2024 04:13:11 EDT (-0400)
  Re: Changing image maps' transparency?  
From: Kenneth
Date: 16 Dec 2009 06:05:01
Message: <web.4b28baf16cafa19665f302820@news.povray.org>
SharkD <mik### [at] gmailcom> wrote:
> Is there a way to adjust the transparency without modifying the images
> themselves? Thanks!
>

I forgot to mention a rather simple technique I came up with awhile ago. (I'm
somewhat embarrassed to admit that I didn't remember it in relation to your
question until now--even though I use it quite frequently! Sometimes I forget
techniques I've used in the past, and end up 'reinventing the wheel'...)

It's probably not as visually correct as clipka's ideas, but works well enough
in many situations. It uses a simple pigment_map:

pigment{
     average
     pigment_map{
             [1.0 png "my_image.png"] // has alpha-channel transparency
             [1.0 rgbt <.5,.5,.5,1>] // fully transparent
                }
       }

Adjust the 'weighting' of the rgbt color to get the amount of transparency you
want.  The drawback is that the 'color' of the rgbt pigment is slightly imposed
on the 'real' part of the image_map, depending on the 'weighting.' (Though NOT
on the *transparent* parts of the alpha-channel image--they remains fully
transparent.)  Through experience, I chose rgbt <.5,.5,.5,1> (a 'transparent
gray') as it seems to have the least visual impact on the image_map.

Ken


Post a reply to this message

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