POV-Ray : Newsgroups : povray.general : Making Background transparent... Server Time
9 Aug 2024 11:24:10 EDT (-0400)
  Making Background transparent... (Message 1 to 10 of 28)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Martin
Subject: Making Background transparent...
Date: 22 Sep 2000 09:58:49
Message: <39CB65BF.B5C9F0B6@thomatechnik.de>
Hello !

For a Web-Image I need to make the background transparent. What's the
best way to do it ? Is there something like a "build-in"-transparent
background ?

Martin


Post a reply to this message

From: Ron Parker
Subject: Re: Making Background transparent...
Date: 22 Sep 2000 10:09:39
Message: <slrn8smqqb.5oe.ron.parker@fwi.com>
On Fri, 22 Sep 2000 15:59:27 +0200, Martin wrote:
>For a Web-Image I need to make the background transparent. What's the
>best way to do it ? Is there something like a "build-in"-transparent
>background ?

You can use +UA while outputting to a format that supports alpha 
transparency (PNG or TGA).  You'll need some sort of external program 
to convert to transparent GIF (gag, spit).  Be aware that support for
transparent TGA is spotty; even Photoshop (version 4 anyway) doesn't 
support them correctly.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.
Proudly not helping RIAA and SDMI steal my rights -- 
  http://www.eff.org/Misc/EFF/Newsletters/EFFector/HTML/effect13.08.html


Post a reply to this message

From: Tom Melly
Subject: Re: Making Background transparent...
Date: 22 Sep 2000 10:19:54
Message: <39cb6a8a$1@news.povray.org>
"Martin" <mar### [at] thomatechnikde> wrote in message
news:39CB65BF.B5C9F0B6@thomatechnik.de...
> Hello !
>
> For a Web-Image I need to make the background transparent. What's the
> best way to do it ? Is there something like a "build-in"-transparent
> background ?
>

I'm sure there's a way to do this directly in POV, but the easiest way is:

a) make your background a solid colour not in use elsewhere in your image.

b) open the finished image in a paint prog (example here is psp).

c) reduce colours to 256

d) pick the background colour with a dropper or similiar tool and either set
this as the second pallette colour or make a mental note of its index value
(this will show up in the pallette toolbar next to an "I" when the dropper
hovers over the colour).

e) use the "colors" menu to set pallette transparency to this value.

f) save image as either gif or png (png is better for ethical reasons, gif
for cross-browser compatibility)

One point is that you should be careful in POV to pick a background colour
that won't dither when reduced to 256. Pure black, white, green, red or blue
are good for this, but other colours will also work.


Post a reply to this message

From: Warp
Subject: Re: Making Background transparent...
Date: 22 Sep 2000 10:53:23
Message: <39cb7263@news.povray.org>
Output to png and use the +ua command line option. Every ray that doesn't
hit any object will affect the alpha channel.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: David Fontaine
Subject: Re: Making Background transparent...
Date: 22 Sep 2000 21:54:50
Message: <39CC0BFC.304A9757@faricy.net>
Ron Parker wrote:

> You can use +UA while outputting to a format that supports alpha
> transparency (PNG or TGA).  You'll need some sort of external program
> to convert to transparent GIF (gag, spit).  Be aware that support for
> transparent TGA is spotty; even Photoshop (version 4 anyway) doesn't
> support them correctly.

Hey, cool. That could prove very useful!
When using aa, does POV aa the alpha channel too so you can have a smooth
transition to the background?

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Rune
Subject: Re: Making Background transparent...
Date: 23 Sep 2000 06:53:35
Message: <39cc8baf@news.povray.org>
"David Fontaine" wrote:
> When using aa, does POV aa the alpha channel too so
> you can have a smooth transition to the background?

Yes, but unfortunately the *colour* isn't antialiased correctly.

When alpha is on, POV-Ray still use the background colour when it calculates
AA'ed pixels. It shouldn't. It's like it takes the background into account
twice - both in the colours and in the transparency. It should only do it in
the transparency.

Say you have a red sphere on a black background. The AA'ed pixels should
have the same red colour as the sphere but with some transparency. But
instead they are a darker red with some transparency because they are mixed
with the black background colour.

Result: When you use the alpha channel together with antialiasing, objects
will seem to have a very thin halo around them with the same colour as the
background colour you originally used.

But a much bigger problem is the way POV-Ray handles (semi-)transparent
objects. They are handled as though they were solid.

I'm not saying it's a bug. Maybe it's just an (in my opinion) unwanted
feature. But I would certainly appreciate it if somebody would fix it!

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated July 23)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Warp
Subject: Re: Making Background transparent...
Date: 23 Sep 2000 14:49:24
Message: <39ccfb33@news.povray.org>
Rune <run### [at] inamecom> wrote:
: When alpha is on, POV-Ray still use the background colour when it calculates
: AA'ed pixels. It shouldn't. It's like it takes the background into account
: twice - both in the colours and in the transparency. It should only do it in
: the transparency.

: Say you have a red sphere on a black background. The AA'ed pixels should
: have the same red colour as the sphere but with some transparency. But
: instead they are a darker red with some transparency because they are mixed
: with the black background colour.

  Then you'll wonder why the edges don't look antialiased when you look
at the image with a program that doesn't support the alpha channel (or
when povray itself shows the image).

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Rune
Subject: Re: Making Background transparent...
Date: 23 Sep 2000 19:20:11
Message: <39cd3aab@news.povray.org>
"Warp" wrote:
> Rune wrote:
>
> : Say you have a red sphere on a black background.
> : The AA'ed pixels should have the same red colour as the
> : sphere but with some transparency.
>
>   Then you'll wonder why the edges don't look antialiased
> when you look at the image with a program that doesn't
> support the alpha channel (or when povray itself shows
> the image).

That is correct, and that is the way it should be (in my opinion).
(Not the wondering part but the rest.)

When you have turned the alpha channel on in POV-Ray, one must expect it to
be first priority that the image works correctly *with* alpha channel
support.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated July 23)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Warp
Subject: Re: Making Background transparent...
Date: 23 Sep 2000 19:38:39
Message: <39cd3eff@news.povray.org>
Rune <run### [at] inamecom> wrote:
: When you have turned the alpha channel on in POV-Ray, one must expect it to
: be first priority that the image works correctly *with* alpha channel
: support.

  What is the correct behaviour?

  For example, let's suppose that we are calculating a pixel which is
located at the crossing of the edges of two objects.
  One object is red (<1,0,0>) and takes 50% of the pixel area. The other
object is green (<0,1,0>) and takes 25% of the pixel area. The last 25%
of the pixel is background.
  What should be the RGBA values for that pixel?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Peter Popov
Subject: Re: Making Background transparent...
Date: 24 Sep 2000 04:23:19
Message: <58erss8t6unm078r2t2p9365ok7h0lu58s@4ax.com>
On Sun, 24 Sep 2000 01:18:33 +0200, "Rune" <run### [at] inamecom>
wrote:

>When you have turned the alpha channel on in POV-Ray, one must expect it to
>be first priority that the image works correctly *with* alpha channel
>support.

Rune, the way POV works *is* the correct way. If you don't like it,
you can always remove the black/white matte or defringe it in
PhotoShop. It will take care of removing the leftovers from the
background based on the alpha channel intensity.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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