Component transfer filter doesn't work on Alpha channel

Bug #779266 reported by ivan louette
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

I tried to use FeComponentTransfer Discrete on blured or semi-transparent pictures and it doesn't work. I don't understand because Alpha is a 8bit image and it should work on it. Or is that an SVG limitation ?

Tags: filters-svg
su_v (suv-lp)
tags: added: filters-svg
Revision history for this message
Jaspervdg (jaspervdg) wrote :

Do you have a specific example to look at? (Preferably as small as possible.)

Revision history for this message
ivan louette (ivan-louette) wrote :

Here are two examples : one where discrete is applied on a semi transparent bitmap image and a second one where it is applied on a blurred object. In the two examples I have built a filter which show what I expect when applying discrete on these semi transparent or blurred objects. It partly works on the bitmap image but it keeps smooth gradients inside the discrete steps.

It's a little bit like if alpha wasn't an opaque greyscale image but already a transparent greyscale image. Like some redundancy ?

Revision history for this message
ivan louette (ivan-louette) wrote :
Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

Blurring a solid green object does not mix the green with the background color (if anything, it would mix it with transparent black). In this case, effectively, only the alpha is blurred.

One can see that the filter is working by applying it to a group containing a green blurred rectangle over a white or black background (see attached SVG).

As Inkscape rendering matches Firefox, Chrome, and Batik (squiggle) rendering, I would close this as not a bug.

Note that the non-uniformity is probably due to Inkscape using pre-multiplied (with alpha) colors. Dividing out and the remultiplying by alpha will introduce some rounding errors.

Revision history for this message
ivan louette (ivan-louette) wrote :

Recently I discovered I took the wrong way when trying to connect Component Transfer Discrete to alpha channel on right in the dialog box. The right way to do it is simply to change identity to discrete on the fourth line below (A) in the effect settings dialog and adding the desired number steps. This line correspond to Alpha. And doing that the blur is perfectly posterized like in your modified file.

Revision history for this message
ivan louette (ivan-louette) wrote :

Sorry I forgot I added a simple Composite In to the filter to make it working on top of dark or coloured background !

Here is the file modified.

Revision history for this message
ivan louette (ivan-louette) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.