POV-Ray : Newsgroups : povray.binaries.images : Using "transmit all" with an image map : Re: Using "transmit all" with an image map Server Time
25 Apr 2024 18:29:33 EDT (-0400)
  Re: Using "transmit all" with an image map  
From: Christian Froeschlin
Date: 6 Jan 2023 14:48:04
Message: <63b87af4@news.povray.org>
On 30.12.2022 00:01, Dave Blandston wrote:
> Le_Forgeron <jgr### [at] freefr> wrote:
>> color mapped images are image with a palette, not true/direct color.
>>
>> For example, gif is always palette mapped, whereas jpeg is not.
>> Png is variable: it could have a palette or not.
>> ("indexed": there is a palette; grayscale & truecolor: no palette)
>>
>> This has nothing to do with transparency channel;
>> Gif can have it, png too, but I have never seen jpeg with it.
>>
>> Alain suggested to not use "transmit all" for that picture, but to have
>> the transparency directly from the picture. (without any modifier)
>>
>> You would edit first the transparency in your favorite editor and voilà.
> 
> 
> 
> Using a paint program to adjust the transparency is what I'm currently doing to
> achieve the result that I want but it's not a perfect solution because of the
> number of images involved. I'm using the "transmit all" feature to animate some
> elements of a website mockup animation that fade in and fade out, such as
> buttons and pop-ups and such. Images that don't require different levels of
> transparency work great and I can use "transmit all," and only one copy of the
> image needs to be made. But images that require part of the image to be fully
> transparent exhibit the problem in the image posted above, so I can't use
> "transmit all" and I have to make many copies of the image with the varying
> levels of transparency which is very tedious. That's why I was curious if there
> was a better way so I just thought I'd ask. I should have a sample animation
> ready to post soon that will make this more clear. It's a fun project.
> 

You can use a pigment function to get control over the transmit value:



#version 3.7;

global_settings {assumed_gamma 2.2}

camera {
    orthographic
    location <0, 0, -1>
    right image_width / image_height * x
    direction <0, 0, 1>
    look_at <0, 0, 0>
} //camera

#include "colors.inc"

background {Orange}

#local ImagePigment    = pigment {image_map {png "ABBA.png" gamma 2.2 map_type 0 once
} }
#local ImageResolution = max_extent (ImagePigment);

#local ImageFunction   = function {pigment { ImagePigment} }

#local FADE_STRENGTH = 0.5;

#local FR = function {ImageFunction(x,y,z).red}
#local FG = function {ImageFunction(x,y,z).green }
#local FB = function {ImageFunction(x,y,z).blue }
#local FT = function {1 - (1 - FADE_STRENGTH) * (1-ImageFunction(x,y,z).transmit) }

#local FadePigment = pigment { average pigment_map
{
    [function{FR(x,y,z)} color_map{[0 rgb 0][1 rgbft 4*<1,0,0,0,0>]}]
    [function{FG(x,y,z)} color_map{[0 rgb 0][1 rgbft 4*<0,1,0,0,0>]}]
    [function{FB(x,y,z)} color_map{[0 rgb 0][1 rgbft 4*<0,0,1,0,0>]}]
    [function{FT(x,y,z)} color_map{[0 rgb 0][1 rgbft 4*<0,0,0,0,1>]}]
}

}


object {
    box {<0, 0, 0> <1, 1, .01>}
    texture {pigment {FadePigment} finish {emission .9} scale <1, 1.0000001, 1>}
    translate <-.5, -.5, 0>
    scale <1, ImageResolution.y / ImageResolution.x, 1>
} //object


Post a reply to this message

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