POV-Ray : Newsgroups : povray.binaries.images : using 'transmit all' with PNG alpha-channel image_maps-- a flaw? Server Time
2 Jun 2024 13:23:53 EDT (-0400)
  using 'transmit all' with PNG alpha-channel image_maps-- a flaw? (Message 4 to 13 of 23)  
<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: clipka
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
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

From: Kenneth
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
Date: 10 Jan 2016 22:15:01
Message: <web.56931caf9521477933c457550@news.povray.org>
>
Clipka wrote:
>
> 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".

Yes indeed, that does eliminate the 'hard-edged matte' quirkiness of my
fading-out TIFF image. Thanks for pointing this out. I'm embarrassed to admit
that I *did* read about the new 'premultiplied' keyword-- then promptly forgot
about it.  :-(  I just gave the docs there a good re-reading!  I actually wasn't
sure *why* it was necessary, until now. What a big difference it makes!

So all that remains is to find a fix for the previously-mentioned 'transmit all'
transparency problem, with its erroneous complementary colors etc.  ;-)

Thanks again for taking the time to explain this complex situation so well.


Post a reply to this message

From: clipka
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
Date: 10 Jan 2016 23:24:03
Message: <56932e63$1@news.povray.org>
Am 11.01.2016 um 04:09 schrieb Kenneth:

>> In your case, you'll want to use "premultiplied off".
> 
> Yes indeed, that does eliminate the 'hard-edged matte' quirkiness of my
> fading-out TIFF image. Thanks for pointing this out. I'm embarrassed to admit
> that I *did* read about the new 'premultiplied' keyword-- then promptly forgot
> about it.  :-(  I just gave the docs there a good re-reading!  I actually wasn't
> sure *why* it was necessary, until now. What a big difference it makes!

No reason to be embarrassed: People just forget about stuff if they
don't know what it's good for.

> So all that remains is to find a fix for the previously-mentioned 'transmit all'
> transparency problem, with its erroneous complementary colors etc.  ;-)

Working on it; there's a catch to it though: Currently the injection of
the "transmit all" component happens before compensating for whatever
gamma mode is used in the image. I'll need to wrap my head around the
implications for the formula, or move it someplace else.


> Thanks again for taking the time to explain this complex situation so well.

You're welcome.

By the way, would you mind posting your TIFF test image? The tools I
have at my disposal to quickly create a TIFF with alpha channel all give
me the other alpha mode.


Post a reply to this message

From: clipka
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
Date: 11 Jan 2016 02:09:22
Message: <56935522$1@news.povray.org>
Am 11.01.2016 um 04:09 schrieb Kenneth:

> Yes indeed, that does eliminate the 'hard-edged matte' quirkiness of my
> fading-out TIFF image. Thanks for pointing this out. I'm embarrassed to admit
> that I *did* read about the new 'premultiplied' keyword-- then promptly forgot
> about it.  :-(  I just gave the docs there a good re-reading!  I actually wasn't
> sure *why* it was necessary, until now. What a big difference it makes!
> 
> So all that remains is to find a fix for the previously-mentioned 'transmit all'
> transparency problem, with its erroneous complementary colors etc.  ;-)

The newest `master` branch should fix the interaction between image
alpha channel and "transmit all" (and "filter all" likewise), AND also
implement auto-detection of TIFF alpha mode.

As I'm not really sure whether some existing scenes might be relying on
the old quirk, the new "transmit/filter all" behaviour requires
"#version 3.71".

I'll publish one of those famous(?) semi-official builds once I've
gotten me a fresh batch of round tuits (presumably next weekend).


Post a reply to this message

From: Thomas de Groot
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
Date: 11 Jan 2016 02:51:03
Message: <56935ee7$1@news.povray.org>
On 11-1-2016 8:08, clipka wrote:

> I'll publish one of those famous(?) semi-official builds once I've
> gotten me a fresh batch of round tuits (presumably next weekend).
>

I found a few old ones in my drawer. Just needs dusting off. Shall I 
send them to to you? :-)

-- 
Thomas


Post a reply to this message

From: clipka
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
Date: 11 Jan 2016 07:30:01
Message: <web.5693a04495214779ad6fa18f0@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> On 11-1-2016 8:08, clipka wrote:
>
> > I'll publish one of those famous(?) semi-official builds once I've
> > gotten me a fresh batch of round tuits (presumably next weekend).
> >
>
> I found a few old ones in my drawer. Just needs dusting off. Shall I
> send them to to you? :-)

Please do so - I can always use a few extra ones :)


Post a reply to this message

From: Thomas de Groot
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
Date: 11 Jan 2016 07:45:21
Message: <5693a3e1$1@news.povray.org>
On 11-1-2016 13:29, clipka wrote:
> Thomas de Groot <tho### [at] degrootorg> wrote:
>> On 11-1-2016 8:08, clipka wrote:
>>
>>> I'll publish one of those famous(?) semi-official builds once I've
>>> gotten me a fresh batch of round tuits (presumably next weekend).
>>>
>>
>> I found a few old ones in my drawer. Just needs dusting off. Shall I
>> send them to to you? :-)
>
> Please do so - I can always use a few extra ones :)
>
>
The homing pigeon is on its way. :-)

-- 
Thomas


Post a reply to this message

From: clipka
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
Date: 12 Jan 2016 00:44:48
Message: <569492d0$1@news.povray.org>
Am 11.01.2016 um 08:08 schrieb clipka:

> The newest `master` branch should fix the interaction between image
> alpha channel and "transmit all" (and "filter all" likewise), AND also
> implement auto-detection of TIFF alpha mode.
> 
> As I'm not really sure whether some existing scenes might be relying on
> the old quirk, the new "transmit/filter all" behaviour requires
> "#version 3.71".
> 
> I'll publish one of those famous(?) semi-official builds once I've
> gotten me a fresh batch of round tuits (presumably next weekend).

Thomas' carrier pigeon just arrived with a batch of tuits, so here's the
newest semi-official Windows build:

https://github.com/c-lipka/povray/releases/tag/v3.7.1-alpha.8431463%2Bav74

Sadly there weren't enough round ones in the batch to also build a
64-bit binary, so 64-bit users eager to test-drive the new version will
have to make do with the 32-bit SSE2 edition for now. (Shouldn't be too
much of a problem though unless you want to render memory-hungry scenes.)


Post a reply to this message

From: Kenneth
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
Date: 12 Jan 2016 09:55:02
Message: <web.5695129a9521477933c457550@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 11.01.2016 um 04:09 schrieb Kenneth:
>

>
> By the way, would you mind posting your TIFF test image? The tools I
> have at my disposal to quickly create a TIFF with alpha channel all give
> me the other alpha mode.

Glad to; here it is. (Sorry for the delay; I had to help a friend move to a new
house yesterday. What a chore!)

The file is 1.37 MB on my end; I hope it goes through.

I'm not absolutely sure that my older version of Photoshop (v5.0!) produces TIFF
images strictly according to spec-- I recall that earlier versions of PS were
notorious for PNG problems-- so you might want to check the image's code to make
sure that it's correct.


Post a reply to this message


Attachments:
Download 'alpha_channel_tester_5_tiff.tif.dat' (1410 KB)

From: Dick Balaska
Subject: Re: using 'transmit all' with PNG alpha-channel image_maps-- a flaw?
Date: 12 Jan 2016 10:00:23
Message: <MPG.30fedf1235f72164989698@news.povray.org>
In article <56935522$1@news.povray.org>, ano### [at] anonymousorg says...
> As I'm not really sure whether some existing scenes might be relying 
on
> the old quirk, the new "transmit/filter all" behaviour requires
> "#version 3.71".

We jumped from #version 3.7 to #version 3.71 ?  I missed a couple of 
updates... 
;)


Post a reply to this message

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

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