POV-Ray : Newsgroups : povray.programming : Background colours and antialiasing : Re: Background colours and antialiasing Server Time
28 Jul 2024 20:21:12 EDT (-0400)
  Re: Background colours and antialiasing  
From: Peter Harris
Date: 28 Aug 2000 18:26:52
Message: <39aae72c@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:39aa9172@news.povray.org...
> Peter Harris <pet### [at] hclcom> wrote:
> : Or render against a black background. (The black, at least, won't taint
your
> : colour when you eventually mix with your final background.)
>
>   It will still have influence in the color of the object: It will darken
it.

Well, yes. But given that the point of having an alpha channel available is to
blend with other information (a static background, for example), this is not
unreasonable.

For something like POV, a more accurate method such as:

[ S * A + D * (MAX - A) ] / MAX

might be used. However, for quick applications (games, realtime overlays) a
pre-darkened image actually saves a multiply (at the cost of a bit or so of
accuracy):

S + [(D * (MAX - A))/MAX]

Of course, the PNG spec requires a non-premultiplied alpha. How close to the
spec is POV? I imagine that POV ignores this portion of the spec, as it is
non-trivial to get right in the case of any background other than black.
Writing a simple little program to 'correct' a given .PNG when you can
guarantee that it was blended vs. black (or white, for that matter) would be
fairly easy. Colour accuracy would get pretty bad as pixels approached
transparent, though. I suspect that it would be better as a patch to MegaPOV.


Post a reply to this message

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