POV-Ray : Newsgroups : povray.programming : Suggestion: alpha channel control Server Time
28 Jul 2024 22:16:53 EDT (-0400)
  Suggestion: alpha channel control (Message 1 to 9 of 9)  
From: Peter Popov
Subject: Suggestion: alpha channel control
Date: 22 Apr 1999 06:44:13
Message: <371eef01.2404286@news.povray.org>
I posted this in povray.general about a week ago, but 1) that was not
the right place to and 2) there was some massove discussion going on
so nobody noticed it. I might be luckier this time :)

// message follows

Do you guys think that having a means of implicitly specifying the
alpha channel of an object base makes any sense? I am thinking along
the following lines:

[object type]
{
  object settings...
  texture setings...
  interior settings...

  alpha
  {
    [pattern [pattern modifiers]  [transparency map] ]
    [transformations]
    [channel settings]
  }
}

For example, you can have the following:

global_settings
{
  alpha_channels 2   // 0..1
}

sphere
{
  0, 1
  pigment { Red }
  alpha
  {
    channel 0
    invert
    wood
    ramp_wave
    {
       alpha_map
      {
        [0 White]
        [0.9 White]
        [1 Black]
      }
    }
  }
}

box
{
  <0.5,0,1.1>, <1.5,1,2.1>
  pigment { Blue }
  alpha
  {
    channel 1
    invert
  }
}

plane
{
  y, 0
  pigment { Green }
  alpha { transparency off }

Alpha channel 0 will look like a white circle with fuzzy edges, and
channel 1 will be white where the cube is visible (not hidden by the
sphere}. The ground plane will not affect the alpha channels at all. I
am assuming the default camera and default point light source from the
insert menu have been used.

Some clarifications of the above keywords:

In global_settings the number of alpha channels is specified. Both PNG
and TGA support multichannel.

In the alpha properties of an object all alpha related settings are
specified.

The channel keyword specifies the alpha channel for the current
object. Channels are zero-indexed.

Any pattern can be used for an object's alpha. All pattern modifiers
(turbulence, frequency and the like), warps and transformations should
be applicable to it. The colors in the alpha map or list (eg. checker,
hexagon, bricks) are either rgb->grayscale converted or only one color
component is used (eg. red, as in tga height_fields).

The transparency keyword is a "pattern" type applicable only for alpha
channel settings. It can take a float in the range [0..1]. The usage
of the transparency keyword overrides the alpha pattern.

The invert keyword indicates that higher values mean less transparency
(useful for making selections).

Well, that's basically it. Does it make sense? Is it hard to
implement? Is it worth the effort? Comments are welcome.


---------
Peter Popov
ICQ: 15002700


Post a reply to this message

From: Spider
Subject: Re: Suggestion: alpha channel control
Date: 22 Apr 1999 18:06:58
Message: <371F848C.B6C6AACC@bahnhof.se>
Hmm, i'm not certain I understand what the alpha channel really is, as I see it
it is a channel that is applied over the rest image, and that controls the
"transparencey" of each pixel. is this it ?

Peter Popov wrote:
> 
> I posted this in povray.general about a week ago, but 1) that was not
> the right place to and 2) there was some massove discussion going on
> so nobody noticed it. I might be luckier this time :)
Perhaps. I read the first post, but hoped for a discussion so I could have some
more facts about the alpha channels before I went in and commented. Now,I'll
have to show my ignorance and ask you pplz (and uncle ken) instead. :-)

<snip>


Post a reply to this message

From: Bob Hughes
Subject: Re: Suggestion: alpha channel control
Date: 23 Apr 1999 00:58:03
Message: <371FEF63.23A607A@aol.com>
I only just recently tried alpha channel output +UA as a png file and
then used that as an image file and saw nothing different.
Yes, transmit and filter were applied to 'all'. Maybe it did, maybe it
didn't change it, I was looking for the obvious.
Opening the file with PSP showed the image to definately have Alpha as
compared to a non-Alpha png. Thing is PSP couldn't show anything there,
just black or blank, even if I added a second channel in with PSP
itself.
I also used Bits_per_Color to increase the "bandwith" so to speak to
make room for 8 bits of transparency info in that Alpha Channel.
I never understood it to begin with, and now I know why. I agree, the
only way to learn is if others have used it and can manage a
tutorial-like explanation or a word of sense about it at least.


Spider wrote:
> 
> Hmm, i'm not certain I understand what the alpha channel really is, as I see it
> it is a channel that is applied over the rest image, and that controls the
> "transparencey" of each pixel. is this it ?
> 
> Peter Popov wrote:
> >
> > I posted this in povray.general about a week ago, but 1) that was not
> > the right place to and 2) there was some massove discussion going on
> > so nobody noticed it. I might be luckier this time :)
> Perhaps. I read the first post, but hoped for a discussion so I could have some
> more facts about the alpha channels before I went in and commented. Now,I'll
> have to show my ignorance and ask you pplz (and uncle ken) instead. :-)
> 
> <snip>

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto:inv### [at] aolcom?Subject=PoV-News


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Suggestion: alpha channel control
Date: 23 Apr 1999 10:57:39
Message: <37207c53.0@news.povray.org>
In article <371### [at] aolcom> , Bob Hughes <inv### [at] aolcom>  
wrote:

> I only just recently tried alpha channel output +UA as a png file and
> then used that as an image file and saw nothing different.

Did you use a sky_sphere? The alpha-channel will only work with background.

> Yes, transmit and filter were applied to 'all'. Maybe it did, maybe it
> didn't change it, I was looking for the obvious.
> Opening the file with PSP showed the image to definately have Alpha as
> compared to a non-Alpha png. Thing is PSP couldn't show anything there,
> just black or blank, even if I added a second channel in with PSP
> itself.
> I also used Bits_per_Color to increase the "bandwith" so to speak to
> make room for 8 bits of transparency info in that Alpha Channel.
> I never understood it to begin with, and now I know why. I agree, the
> only way to learn is if others have used it and can manage a
> tutorial-like explanation or a word of sense about it at least.

Well, actually it is easy:

An alpha-channel is a fourth component saved with each pixel. It determines
how much of the background behind an image comes through. This is usually
useful for editing the image later in Paint Shop Pro, Photoshop or Gimp(?)
and combine it with other images.
In POV-Ray you need to do some setup to get an alpha-channel output:
- Set the alpha-channel option +UA or Output_Alpha=true.
- To get a full alpha-channel, make sure Bits_per_Color is set to 8.
- Make sure you don't use sky_shpere {}. The alpha-channel will only be
visible when using background {}. During rendering you will still see the
background, no alpha-channel (except on POV-Ray Mac which can preview the
alpha-channel).
- To make objects (half) transparent in the alpha-channel use the transmit
color component - filter won't work. A value 1.0 is full transparency.

I hope this explains how to use it. :-)


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: Tho### [at] csicom

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Bob Hughes
Subject: Re: Suggestion: alpha channel control
Date: 23 Apr 1999 18:34:29
Message: <3720E730.86D07306@aol.com>
Hey great, I understood that very well.
No sky_sphere huh, okay, I had one. 8 bits? Okay again, I set that to
more in case it was going to need more over the usual 24-bit image
capacity, I'll go back and try this out.
Thanks so much.


Thorsten Froehlich wrote:
> 
> In article <371### [at] aolcom> , Bob Hughes <inv### [at] aolcom>
> wrote:
> 
> > I only just recently tried alpha channel output +UA as a png file and
> > then used that as an image file and saw nothing different.
> 
> Did you use a sky_sphere? The alpha-channel will only work with background.
> 
> > Yes, transmit and filter were applied to 'all'. Maybe it did, maybe it
> > didn't change it, I was looking for the obvious.
> > Opening the file with PSP showed the image to definately have Alpha as
> > compared to a non-Alpha png. Thing is PSP couldn't show anything there,
> > just black or blank, even if I added a second channel in with PSP
> > itself.
> > I also used Bits_per_Color to increase the "bandwith" so to speak to
> > make room for 8 bits of transparency info in that Alpha Channel.
> > I never understood it to begin with, and now I know why. I agree, the
> > only way to learn is if others have used it and can manage a
> > tutorial-like explanation or a word of sense about it at least.
> 
> Well, actually it is easy:
> 
> An alpha-channel is a fourth component saved with each pixel. It determines
> how much of the background behind an image comes through. This is usually
> useful for editing the image later in Paint Shop Pro, Photoshop or Gimp(?)
> and combine it with other images.
> In POV-Ray you need to do some setup to get an alpha-channel output:
> - Set the alpha-channel option +UA or Output_Alpha=true.
> - To get a full alpha-channel, make sure Bits_per_Color is set to 8.
> - Make sure you don't use sky_shpere {}. The alpha-channel will only be
> visible when using background {}. During rendering you will still see the
> background, no alpha-channel (except on POV-Ray Mac which can preview the
> alpha-channel).
> - To make objects (half) transparent in the alpha-channel use the transmit
> color component - filter won't work. A value 1.0 is full transparency.
> 
> I hope this explains how to use it. :-)
> 
>     Thorsten
> 
> ____________________________________________________
> Thorsten Froehlich, Duisburg, Germany
> e-mail: Tho### [at] csicom
> 
> Visit POV-Ray on the web: http://mac.povray.org

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto:inv### [at] aolcom?Subject=PoV-News


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Suggestion: alpha channel control
Date: 24 Apr 1999 00:03:43
Message: <3721348f.0@news.povray.org>
In article <3720E730.86D07306@aol.com> , Bob Hughes <inv### [at] aolcom>  
wrote:

> No sky_sphere huh, okay, I had one. 8 bits? Okay again, I set that to
> more in case it was going to need more over the usual 24-bit image
> capacity

Well, when you generate an image with alpha-channel you get a 32-bit image.
Only PNG supports more than 8 bpc, however, no program seems to support more
than that (they reduce it to 8 bit again). And at least one program (the PNG
import plug-in for PhotoShop 4.0 on the Mac) seem to have/had problems with
PNG images over 8 bpc and an alpha-channel...


      Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: Tho### [at] csicom

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Steve
Subject: Re: Suggestion: alpha channel control
Date: 24 Apr 1999 03:09:16
Message: <372160FD.7CCB80E7@puzzlecraft.com>
Alpha Channels can be used for anything. PlateMaker plug-in for Photoshop
allows an image to carry 256 channels, each one holding it's own unique set of
data. Each channel is limited to 8 bits I believe. It would be very interesting
if the user could map the channels to POV functions. We could then use as many
channels as we wanted to.

steve

Thorsten Froehlich wrote:

> In article <3720E730.86D07306@aol.com> , Bob Hughes <inv### [at] aolcom>
> wrote:
>
> > No sky_sphere huh, okay, I had one. 8 bits? Okay again, I set that to
> > more in case it was going to need more over the usual 24-bit image
> > capacity
>
> Well, when you generate an image with alpha-channel you get a 32-bit image.
> Only PNG supports more than 8 bpc, however, no program seems to support more
> than that (they reduce it to 8 bit again). And at least one program (the PNG
> import plug-in for PhotoShop 4.0 on the Mac) seem to have/had problems with
> PNG images over 8 bpc and an alpha-channel...
>
>       Thorsten
>
> ____________________________________________________
> Thorsten Froehlich, Duisburg, Germany
> e-mail: Tho### [at] csicom
>
> Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Ken
Subject: Re: Suggestion: alpha channel control
Date: 24 Apr 1999 03:10:07
Message: <37215FC6.8EE2DC0@pacbell.net>
Thorsten Froehlich wrote:
> 
> In article <3720E730.86D07306@aol.com> , Bob Hughes <inv### [at] aolcom>
> wrote:
> 
> > No sky_sphere huh, okay, I had one. 8 bits? Okay again, I set that to
> > more in case it was going to need more over the usual 24-bit image
> > capacity
> 
> Well, when you generate an image with alpha-channel you get a 32-bit image.
> Only PNG supports more than 8 bpc, however, no program seems to support more
> than that (they reduce it to 8 bit again). And at least one program (the PNG
> import plug-in for PhotoShop 4.0 on the Mac) seem to have/had problems with
> PNG images over 8 bpc and an alpha-channel...
> 
>       Thorsten

  I would not be surprised if it all ties in with the same behavior seen
when specifying filter and transmit for image maps. If your png image is
24 bit the function does not work. If you reduce it to 8 bit 256 color you
get predictable results. I was discussing this in the .general group some
time last week.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Patrick Magee
Subject: Re: Suggestion: alpha channel control
Date: 29 Apr 1999 19:28:02
Message: <3728DCF1.D8FD9BA3@fltdyn.com>
I use alpha channel tga files for animations which I import into Premiere. By using
the alpha channel I can "blue screen" the animation onto other animations or video.
Works pretty well!

Bob Hughes wrote:

> I only just recently tried alpha channel output +UA as a png file and
> then used that as an image file and saw nothing different.
> Yes, transmit and filter were applied to 'all'. Maybe it did, maybe it
> didn't change it, I was looking for the obvious.
> Opening the file with PSP showed the image to definately have Alpha as
> compared to a non-Alpha png. Thing is PSP couldn't show anything there,
> just black or blank, even if I added a second channel in with PSP
> itself.
> I also used Bits_per_Color to increase the "bandwith" so to speak to
> make room for 8 bits of transparency info in that Alpha Channel.
> I never understood it to begin with, and now I know why. I agree, the
> only way to learn is if others have used it and can manage a
> tutorial-like explanation or a word of sense about it at least.
>
> Spider wrote:
> >
> > Hmm, i'm not certain I understand what the alpha channel really is, as I see it
> > it is a channel that is applied over the rest image, and that controls the
> > "transparencey" of each pixel. is this it ?
> >
> > Peter Popov wrote:
> > >
> > > I posted this in povray.general about a week ago, but 1) that was not
> > > the right place to and 2) there was some massove discussion going on
> > > so nobody noticed it. I might be luckier this time :)
> > Perhaps. I read the first post, but hoped for a discussion so I could have some
> > more facts about the alpha channels before I went in and commented. Now,I'll
> > have to show my ignorance and ask you pplz (and uncle ken) instead. :-)
> >
> > <snip>
>
> --
>  omniVERSE: beyond the universe
>   http://members.aol.com/inversez/homepage.htm
>  mailto:inv### [at] aolcom?Subject=PoV-News


Post a reply to this message

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