POV-Ray : Newsgroups : povray.general : Making Background transparent... Server Time
9 Aug 2024 03:23:25 EDT (-0400)
  Making Background transparent... (Message 11 to 20 of 28)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 8 Messages >>>
From: Rune
Subject: Re: Making Background transparent...
Date: 24 Sep 2000 07:37:23
Message: <39cde773@news.povray.org>
"Warp" wrote:
>   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?

After the method *I* think is correct:

Colour: 0.67*red + 0.33*green => <0.67,0.33,0.00>

Alpha: 0.50*1 + 0.25*1 + 0.25*0 => 0.75

When you in a paint program put a background colour behind the image layer
the final colour value of the pixel will be like this:

image_colour*0.75 + background_colour*0.25

If the bg_colour is black the final colour will be: <0.50,0.25,0.00>
But if the background colour is white the colour will be: <0.75,0.50,0.25>

So no matter what colour you put behind your image the antialiasing will
work nicely without leaving any hint of what background colour you
originally used in POV-Ray. That is what I think is correct behaviour.

I'll make some images that shows what I mean and post them to
povray.binaries.images...

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: Rune
Subject: Re: Making Background transparent...
Date: 24 Sep 2000 07:37:27
Message: <39cde777@news.povray.org>
"Peter Popov" wrote:
> 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.

Why is an external program necessary to remove the traces of the background
I used in POV-Ray? I don't have PhotoShop.

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: PoD
Subject: Re: Making Background transparent...
Date: 24 Sep 2000 15:20:58
Message: <39CE5416.C4038215@merlin.net.au>
Peter Popov wrote:
> 
> 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.
> 

At the edges of objects the rgb values of the object are AAed with the
background colour.  When I turn on transparency, it's because I want the
background to represent _nothing_, how can nothing have a colour?  There
should be no leftovers to remove.

PoD.


Post a reply to this message

From: Rune
Subject: Re: Making Background transparent...
Date: 24 Sep 2000 16:21:42
Message: <39ce6256@news.povray.org>
"PoD" wrote:
> At the edges of objects the rgb values of the object are AAed
> with the background colour.  When I turn on transparency, it's
> because I want the background to represent _nothing_, how can
> nothing have a colour?  There should be no leftovers to remove.

Exactly. The background presence should be stored in the alpha
channel only. Not in the red, green and blue components.

I have posted an image to povray.binaries.images and a bug report
to povray.bugreports

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 August 7)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Ron Parker
Subject: Re: Making Background transparent...
Date: 25 Sep 2000 00:38:21
Message: <slrn8stmgo.6ca.ron.parker@fwi.com>
On Sun, 24 Sep 2000 22:19:02 +0200, Rune wrote:
>Exactly. The background presence should be stored in the alpha
>channel only. Not in the red, green and blue components.
>
>I have posted an image to povray.binaries.images and a bug report
>to povray.bugreports

It might have been premature for a post to .bugreports (we'll see; if it's
approved, it wasn't premature :) ) but for what it's worth, I agree that it
should work the way you describe rather than the way it works now.

-- 
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: Thorsten Froehlich
Subject: Re: Making Background transparent...
Date: 25 Sep 2000 01:07:20
Message: <39cedd88$1@news.povray.org>
In article <slr### [at] fwicom> , ron### [at] povrayorg (Ron
Parker) wrote:

>>I have posted an image to povray.binaries.images and a bug report
>>to povray.bugreports
>
> It might have been premature for a post to .bugreports (we'll see; if it's
> approved, it wasn't premature :) ) but for what it's worth, I agree that it
> should work the way you describe rather than the way it works now.

I replied to the image post in povray.binaries.images and suggested to post
it as bug report :-)


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

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


Post a reply to this message

From: Peter Popov
Subject: Re: Making Background transparent...
Date: 26 Sep 2000 14:40:55
Message: <dijsss4ml2u1ncoa95am3528aaospiktbe@4ax.com>
On Sun, 24 Sep 2000 12:15:59 +0200, "Rune" <run### [at] inamecom>
wrote:

>Why is an external program necessary to remove the traces of the background
>I used in POV-Ray? 

These are not traces of the background. These are the actual colors of
the pixels. If the edge of red sphere on a blue background takes only
10% of a pixel, then this pixel will have a color of <0.1,0,0.9> . If
you make it <1,0,0>, antialiasing will be totally useless as no
jaggies will be reduced.

>I don't have PhotoShop.

I only used it as an example.


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


Post a reply to this message

From: Peter Popov
Subject: Re: Making Background transparent...
Date: 26 Sep 2000 15:11:59
Message: <hts1ts4c4b015ephhn9l4l36v46cbv8e2o@4ax.com>
On Sun, 24 Sep 2000 22:19:02 +0200, "Rune" <run### [at] inamecom>
wrote:

>"PoD" wrote:
>> At the edges of objects the rgb values of the object are AAed
>> with the background colour.  When I turn on transparency, it's
>> because I want the background to represent _nothing_, how can
>> nothing have a colour?  There should be no leftovers to remove.
>
>Exactly. The background presence should be stored in the alpha
>channel only. Not in the red, green and blue components.

So, when anti-aliasing, how should POV treat rays that hit the
background? Ignore them?


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


Post a reply to this message

From: Ron Parker
Subject: Re: Making Background transparent...
Date: 26 Sep 2000 15:57:28
Message: <slrn8t20p1.7a3.ron.parker@fwi.com>
On Tue, 26 Sep 2000 22:09:14 +0300, Peter Popov wrote:
>On Sun, 24 Sep 2000 22:19:02 +0200, "Rune" <run### [at] inamecom>
>wrote:
>
>>"PoD" wrote:
>>> At the edges of objects the rgb values of the object are AAed
>>> with the background colour.  When I turn on transparency, it's
>>> because I want the background to represent _nothing_, how can
>>> nothing have a colour?  There should be no leftovers to remove.
>>
>>Exactly. The background presence should be stored in the alpha
>>channel only. Not in the red, green and blue components.
>
>So, when anti-aliasing, how should POV treat rays that hit the
>background? Ignore them?

No, average them in as pure alpha.  Rune has the right idea.

-- 
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: Rune
Subject: Re: Making Background transparent...
Date: 26 Sep 2000 17:40:40
Message: <39d117d8@news.povray.org>
"Peter Popov" wrote:
> If the edge of red sphere on a blue background takes only 10%
> of a pixel, then this pixel will have a color of <0.1,0,0.9> .
> If you make it <1,0,0>, antialiasing will be totally useless
> as no jaggies will be reduced.

The jaggies will disappear when you view the image in a program that
supports the alpha channel. I think my post in povray.binaries.images shows
very well the advantage of the method I describe and the disadvantage of the
current method.

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 August 7)
/ Also visit http://www.povrayusers.org


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 8 Messages >>>

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