POV-Ray : Newsgroups : povray.binaries.images : using 'transmit all' with PNG alpha-channel image_maps-- a flaw? : Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw? Server Time
15 May 2024 03:32:42 EDT (-0400)
  Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?  
From: clipka
Date: 10 Jan 2016 14:54:29
Message: <5692b6f5$1@news.povray.org>
Am 10.01.2016 um 19:02 schrieb Kenneth:

> Funny thing: I looked up the TIFF file format on Wikipedia-- a long and detailed
> technical discussion there-- but it fails to even mention that an alpha-channel
> can be used with a TIFF image(!). I had to look elsewhere. I'm guessing that
> TIFF encodes alpha-channel information in an entirely different way than a PNG
> file.

Did I already mention associated (aka pre-multiplied) vs. unassociated
(aka non-premultiplied) alpha?

As a matter of fact, what you're seeing is the effect of an image using
unassociated alpha being incorrectly interpreted as using associated alpha.

As mentioned earlier, PNG uses unassociated alpha, and so does your TIFF
image. But POV-Ray isn't aware of the fact.

With the PNG image file format, the use of unassociated alpha is
mandatory. With TIFF, either mode may be used.

When I cleaned up alpha handling in POV-Ray, I knew TIFF supported
associated alpha, but wasn't aware it allowed both modes, so I
hard-coded it to associated alpha. I never got around to implementing
auto-detection when I later learned that TIFF even provides a header
field informing of the mode used.

I was well aware however that file formats with transparency support
were sometimes created with the wrong alpha mode (heck, even POV-Ray
itself did that prior to 3.7), so I provide a mechanism for users to
override POV-Ray's defaults, by explicitly specifying "premultiplied
off" or "premultiplied on" after the image file name.

In your case, you'll want to use "premultiplied off".


Post a reply to this message

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