POV-Ray : Newsgroups : povray.pov4.discussion.general : filter transmit only with 256 color depth Server Time
28 Mar 2024 20:16:09 EDT (-0400)
  filter transmit only with 256 color depth (Message 1 to 6 of 6)  
From: Adam C
Subject: filter transmit only with 256 color depth
Date: 19 Oct 2021 19:55:00
Message: <web.616f59c6a1e24bda615b33939ea097e3@news.povray.org>
I'm simulating a color film transparency laid upon a surface or another
transparency. Image maps with ambient <1.0 1.0 1.0>, viewed from overhead.

So I have been struggling with poor results from "filter all 1.0" and "transmit
all 1.0" after my pigment image_map of jpg or png with or without alpha channel.

Today I find, " .. can only apply filter or transmit to 8 bit 256 color palleted
images ..", as per this link on the wiki;

https://wiki.povray.org/contentDocumentation:Tutorial_Section_4.1#When_I_use_filter_or_transmit_with_my_.tga_image_map_
nothing_happens.


Looking through the Documentation, I find its also referred to here;
http://www.povray.org/documentation/3.7.0/r3_4.html#r3_4_6_3_2


Thank you, folks. I'll switch to GIF as the intermediary for my transparency,
after scratching my head for several days. There were some interesting results
on the way, but generally too dark black or too opaque white preventing the
scene underneath from being visible.


Post a reply to this message

From: Adam C
Subject: Re: filter transmit only with 256 color depth
Date: 19 Oct 2021 20:15:00
Message: <web.616f5f1ade29d732615b33939ea097e3@news.povray.org>
Looking at;  2.1.2.4 File Output Options here;
http://www.povray.org/documentation/view/3.6.1/219/

I should be using PNG and not GIF. OK. However under Output File Type is says;
"The default output depth for all formats is 8 bits/color".

So my questions is, how can I specify a 256-bit PNG as the output file type? It
looks like the option +Fxn,  +FP256   Am I on the right track here? Will give
that a try now.

Thank you.


Post a reply to this message

From: jr
Subject: Re: filter transmit only with 256 color depth
Date: 20 Oct 2021 01:10:00
Message: <web.616fa477de29d7325bd1b3ba6cde94f1@news.povray.org>
hi,

"Adam C" <ada### [at] anonymousorg> wrote:
> Looking at;  2.1.2.4 File Output Options here;
> http://www.povray.org/documentation/view/3.6.1/219/
>
> I should be using PNG and not GIF. OK. However under Output File Type is says;
> "The default output depth for all formats is 8 bits/color".
>
> So my questions is, how can I specify a 256-bit PNG as the output file type? It
> looks like the option +Fxn,  +FP256   Am I on the right track here? Will give
> that a try now.

8bit per colour channel png:  +fn8

transparency:  +ua

<https://wiki.povray.org/content/Reference:File_Output_Options>


regards, jr.


Post a reply to this message

From: Kenneth
Subject: Re: filter transmit only with 256 color depth
Date: 20 Oct 2021 02:45:00
Message: <web.616fb90cde29d7324cef624e6e066e29@news.povray.org>
I happen to be working with 'transmit' and 'transmit all' at the moment, so I'll
try to help.

[I am running POV-ray v3.8.0 beta 1, but most of the following applies to v3.7
as well; I tested it.)

> So my question is, how can I specify a 256-bit PNG as the output file type?
> It looks like the option +Fxn,  +FP256   Am I on the right track here?

I'm a little confused about your question. If you want a 256-color PNG-- kind of
'like a GIF' with a very limited color palette-- then no, it would be 2, not
256. (I.e., 2 to the 8th power is 256.) But if you want the standard 256-bits
*per color*, then it should be 8, as JR mentioned.

> I'm simulating a color film transparency laid upon a surface or another
> transparency. Image maps with ambient <1.0 1.0 1.0>, viewed from overhead.
>
> So I have been struggling with poor results from "filter all 1.0" and
> "transmit all 1.0" after my pigment image_map of jpg or png with or without
> alpha channel.

Unfortunately, 'transmit all' has had problems in the past, particularly with
alpha-channel image_maps; that was during the early v3.7 days. But the problems
were fixed by one of the developers in 2016, in one of the 3.71-alpha versions.
For a discussion of that, see...

https://news.povray.org/povray.binaries.images/thread/%3Cweb.5690126895214779ad6fa18f0%40news.povray.org%3E/

But there is an interesting workaround for you variable-transparency problem, IF
I understand what you are trying to do. It does not use 'transmit all', but
instead uses a pigment_map with 'transmit --some value--' (assuming you are
using your original images, not GIFs, and that you have pre-#declared one of
your images):

Example:
#declare IMG_1 = // this will ultimately be the faded-out image
pigment{image_map{jpeg "my_image_1.jpg" interpolate 2}}

#declare MY_TEX_1 =
texture{
pigment{
      average
      pigment_map{
           [1 IMG_1]
           [.5 transmit 1]
                 }
       }
finish {...whatever...}
}

This makes the image_map 25% transparent (or maybe 33%?) because of the average
of the two pigment_map 'weights' of 1 and .5. It also works with alpha-channel
images. Surprisingly, 'transmit' can be successfully used here, even though your
image_map probably has the standard 16-million colors. And just as surprisingly,
'transmit all' does NOT work here.

You can vary the two weights to get some other translucency, of course.

Then for your simpler non-faded underlying image, #declare that one as a similar
texture, MY_TEX_2 (but no pigment_map or average for this one, of course.)

Then combine both textures on your box object, or whatever you are using for the
surface:

box{0, <1,1,0> // a zero-thickness box actually works
texture{MY_TEX_2} // the 'base' image and texture, opague
texture{MY_TEX_1} // the semi-transparent image texture
}

(you may have to rotate these by 90-deg, if you're aiming your camera downward).

I hope this helps; if it's unclear, just ask.

------
Strangely, I am getting inconsistent results with 'transmit all' even in v3.8.0
beta 1. It *should* work with any type of image_map-- JPEG, PNG, TIFF etc-- like
the documentation states in

3.6.2.6.3 The Filter and Transmit Bitmap Modifiers:
"You can give the entire image a filter or transmit value using filter all
Amount or transmit all Amount. For example:
image_map {
  gif "stnglass.gif"
  filter all 0.9
  }
"

However, *sometimes* it works, sometimes it does not, and I have no idea why.
I've used it successfully many times in somewhat older versions of POV-ray, so
my current results are rather strange.


Post a reply to this message

From: Kenneth
Subject: Re: filter transmit only with 256 color depth
Date: 20 Oct 2021 06:10:00
Message: <web.616feaa3de29d7324cef624e6e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

>
> I'm a little confused about your question. If you want a 256-color PNG--
> kind of 'like a GIF' with a very limited color palette-- then no, it would
> be 2, not 256. (I.e., 2 to the 8th power is 256.)
>

Sorry, *I* am confused about my answer. My brain is kind of fried tonight; my
apologies.


Post a reply to this message

From: Dick Balaska
Subject: Re: filter transmit only with 256 color depth
Date: 9 Nov 2021 19:01:04
Message: <618b0bc0$6@news.povray.org>
On 10/19/2021 8:13 PM, Adam C wrote:

> 
> I should be using PNG and not GIF. OK. However under Output File Type is says;
> "The default output depth for all formats is 8 bits/color".

OT
I use GIF for input files to POV-Ray so as not to confuse them with the 
PNG which are output files.  Then I can safely `rm *.png`

dik


Post a reply to this message

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