Page 1 of 1

Respecting alpha

Posted: Sat Jun 24, 2017 6:47 pm
by Sadler
I can't find a way to apply certain simple effects to a png with transparency. If I do, the effect gets applied to the whole background.

Take this image to test with :
A white square surrounded by a black square where the centre and the outside are transparent
A white square surrounded by a black square where the centre and the outside are transparent
invert_test.png (2.18 KiB) Viewed 5003 times
If I take two copies and try to invert one I get this:
Left copy is Inverted
Left copy is Inverted
invert_test_result_01.png (3.54 KiB) Viewed 5003 times
If I then try to lighten the other I get this:
The right copy has HueSaturation with Lightness applied
The right copy has HueSaturation with Lightness applied
invert_test_result_02.png (3.5 KiB) Viewed 5003 times
It is not all effects but Invert, Contrast and Hue Saturation affect the background or just treat the alpha as black. Incidentally, Invert, Contrast and Colour FFGL effects seem to respect the alpha more in line with expectations but now that I'm trying to go completely 64bit FFGL is not (currently) an option.

Re: Respecting alpha

Posted: Mon Jun 26, 2017 3:49 pm
by Magic
The issue here is premultiplied alpha vs. non-premultiplied alpha. But I can look into adding an option to handle it better.

Re: Respecting alpha

Posted: Tue Jun 27, 2017 11:04 pm
by Sadler
I guess I should have searched more thoroughly :oops: viewtopic.php?f=2&t=355&hilit=premultiplied

But worthy of a bump, no? Thanks Eric.

Re: Respecting alpha

Posted: Wed Jun 28, 2017 8:09 am
by Magic
Ah yes. Thanks.