POV-Ray : Newsgroups : povray.programming : Background colours and antialiasing Server Time
28 Jul 2024 18:16:30 EDT (-0400)
  Background colours and antialiasing (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Warp
Subject: Re: Background colours and antialiasing
Date: 28 Aug 2000 12:21:07
Message: <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.

-- 
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 Harris
Subject: Re: Background colours and antialiasing
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

<<< Previous 10 Messages Goto Initial 10 Messages

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