POV-Ray : Newsgroups : povray.general : PNG And Transparency. Server Time
7 Aug 2024 19:20:47 EDT (-0400)
  PNG And Transparency. (Message 1 to 7 of 7)  
From: nigel warner
Subject: PNG And Transparency.
Date: 14 Aug 2001 12:22:45
Message: <3b795055@news.povray.org>
Dear All,

    I have searched the new Web newsgroup interface, which is very nice, but
I still can't find
what I'm looking for.

    I am creating some images using text objects in black and white. I would
like to find some way
of creating a PNG file which when loaded into a browser displays the white
as transparent. Is this
possible ? I am using 5 bit per colour PNG output file format and my first
attempt used a background
set to rgbt <1.0,1.0,1.0,1.0> but this did not work. I realise that various
browsers have varying
degrees of support for PNG but is there a way which should theoretically
work ??

    Regards,

    Nigel.


Post a reply to this message

From: Arthur Flint
Subject: Re: PNG And Transparency.
Date: 14 Aug 2001 13:47:19
Message: <3B79649E.1AA23BCE@chesapeake.net>
Maybe one of the graphics programs (ie PSP,GIMP....) can save the
image in the correct format with the alpha channel set to white.

"nigel.warner" wrote:
> 
> Dear All,
> 
>     I have searched the new Web newsgroup interface, which is very nice, but
> I still can't find
> what I'm looking for.
> 
>     I am creating some images using text objects in black and white. I would
> like to find some way
> of creating a PNG file which when loaded into a browser displays the white
> as transparent. Is this
> possible ? I am using 5 bit per colour PNG output file format and my first
> attempt used a background
> set to rgbt <1.0,1.0,1.0,1.0> but this did not work. I realise that various
> browsers have varying
> degrees of support for PNG but is there a way which should theoretically
> work ??
> 
>     Regards,
> 
>     Nigel.


Post a reply to this message

From: Warp
Subject: Re: PNG And Transparency.
Date: 14 Aug 2001 18:58:28
Message: <3b79ad14@news.povray.org>
The PNG format doesn't use a "this color is transparent" value like GIF
does (at least I have never heard of that).
  What PNG uses is a full alpha channel, that is, you can specify an amount
of transparency for each pixel (regardless of its color).
  For example POV-Ray can output PNGs with alpha channel transparency (using
the +UA command line parameter; when a camera ray doesn't hit anything, it's
marked as transparent).

  Now the bad news: No web browser that I know of supports PNG transparency
correctly. So until they do, you'll have to use GIFs.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Jim Kress
Subject: Re: PNG And Transparency.
Date: 17 Aug 2001 00:28:35
Message: <3b7c9d73$1@news.povray.org>
PSP v7 supports either alpha channel or "pick a color" transparency for PNG.

Jim


Post a reply to this message

From: Warp
Subject: Re: PNG And Transparency.
Date: 17 Aug 2001 05:22:46
Message: <3b7ce266@news.povray.org>
Jim Kress <dea### [at] kressworkscom> wrote:
: PSP v7 supports either alpha channel or "pick a color" transparency for PNG.

  But how does it save the transparent color into the PNG file? Does it just
save it as an alpha channel (and the "pick a color" is just a tool to create
automatically the alpha channel)?

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Adrien Beau
Subject: Re: PNG And Transparency.
Date: 17 Aug 2001 07:48:48
Message: <3B7D04A5.F619E35@sycomore.fr>
Warp wrote:
> 
>   But how does it save the transparent color into the PNG file? Does it just
> save it as an alpha channel (and the "pick a color" is just a tool to create
> automatically the alpha channel)?

From http://www.w3.org/TR/REC-png, section 2.4:

" Transparency control is also possible without the storage cost
of a full alpha channel. In an indexed-color image, an alpha
value can be defined for each palette entry. In grayscale and
truecolor images, a single pixel value can be identified as
being "transparent". These techniques are controlled by the
tRNS ancillary chunk type. "

-- 
Adrien Beau - adr### [at] freefr - http://adrien.beau.free.fr
 Mes propos n'engagent que moi et en aucun cas mes employeurs


Post a reply to this message

From: Warp
Subject: Re: PNG And Transparency.
Date: 17 Aug 2001 09:33:27
Message: <3b7d1d27@news.povray.org>
Adrien Beau <adr### [at] sycomorefr> wrote:
: In an indexed-color image, an alpha
: value can be defined for each palette entry.

  Well, this is just a palette with alpha channel (ie. 4 color components).

: In grayscale and
: truecolor images, a single pixel value can be identified as
: being "transparent".

  Ok, this I didn't know.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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