Previous topicNext topic

Respecting alpha

Suggestions for new features for Magic.
Post Reply
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Respecting alpha

Post 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 4858 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 4858 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 4858 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.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Respecting alpha

Post by Magic »

The issue here is premultiplied alpha vs. non-premultiplied alpha. But I can look into adding an option to handle it better.
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Respecting alpha

Post 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.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Respecting alpha

Post by Magic »

Ah yes. Thanks.
Post Reply