POV-Ray : Newsgroups : povray.binaries.images : Alpha Channel and Antialiasing : Re: Alpha Channel and Antialiasing Server Time
20 Aug 2024 00:08:49 EDT (-0400)
  Re: Alpha Channel and Antialiasing  
From: Alexander Enzmann
Date: 29 Sep 2000 08:22:46
Message: <39D48AD5.E86B5FC0@mitre.org>
Rune wrote:
> 
> How should POV-Ray antialiase pixels when the alpha channel is used?
> I think that it currently behave in an undesirable way.

It works the way it ought to.  When using alpha/opacity, you have four
channels in the image.  Three carry color, one carries alpha/opacity. 
Once you have collected together background color and object color into
a pixel (the three color channels), you can't (easily) separate them
back out.

The alpha channel only tells you the amount of contribution of the
background to the final pixel.  If you wanted to remove the background
color from the pixel, you would also need to know the color of the
background that got added in (three more channels in the image).

> 
> Example:
> 
> (A) I render a white torus on a red background with AA on
>     and alpha channel on too.

If you are going to do compositing, you should probably use a black
background.  That way there's no extraneous color contributions.

> 
> (B) In a paint program I want to put this background behind
>     my POV-Ray image.
> 
> (C) Around my white torus there's a red halo - a leftover
>     from the red background I originally used. I don't like that.

Then you shouldn't have used a red background.  However, since you know
the color you originally used for a background, you can remove it from
the image:
   - multiply the original background color by the alpha value
   - subtract from the pixel
   - hope there weren't any out of range values anywhere along the way.

> 
> (D) Instead I think POV-Ray should produce images that works
>     this way (like in image D). However, it won't be changed
>     because the developers think it's better as it currently is
>     (like in image C).

I disagree.  That would be different from almost every image processing
package in existence (besides not being possible without also storing
the entire background along with every image).

Xander


Post a reply to this message

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