Nudge CMY-RGB filters improvement

Bug #1746041 reported by Fabien Fellay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Hello,

I recently released some filters that allow emulating a very basic chromatic aberration effect. They are available here with some explanations:

<https://inkscape.org/en/~fabien.fellay/%E2%98%85chromatic-aberration-filters>

They come with some animated examples as well:

<https://inkscape.org/en/~fabien.fellay/%E2%98%85chromatic-aberration-rgb-cmy-demo>
<https://inkscape.org/en/~fabien.fellay/%E2%98%85chromatic-aberration-rc-cr-demo>
<https://inkscape.org/en/~fabien.fellay/%E2%98%85chromatic-aberration-with-rotating-figures-demo>

I later noticed that Inkscape already has similar filters available in the menu Filters > Color > Nudge RGB/CMY...
Therefore, I am now figuring out that my proposed chromatic aberration filters do not bring something fundamentally new (except from the behavior with the alpha channel of the output according to the input lightness, which is clearly different).

However, if we have to stick with the existing filters, I see 2 issues regarding them that can be improved:

1) Aliazing issue with the 'nudge RGB' filter:

The 'nudge CMY' and the 'nudge RGB' filters do not have a totally symmetrical behavior. While the 'nudge CMY' filter
is perfectly fine, by careful examination, one will notice that the 'nudge RGB' filter suffers from a subtle aliasing effect
at the border of the 3 decomposed layers (present in all browsers rendering and Inkscape itself). However, I found a
nice (not so easy to figure out) solution to this. Replace the 3 color matrices:
 red:
  0 0 0 0 1
  0 0 0 0 0
  0 0 0 0 0
  1 0 0 0 0
 green:
  0 0 0 0 0
  0 0 0 0 1
  0 0 0 0 0
  0 1 0 0 0
 blue:
  0 0 0 0 0
  0 0 0 0 0
  0 0 0 0 1
  0 0 1 0 0
  by the following new ones (in short: add the 1 -1 at the end of the last lines):
 red:
  0 0 0 0 1
  0 0 0 0 0
  0 0 0 0 0
  1 0 0 1 -1
 green:
  0 0 0 0 0
  0 0 0 0 1
  0 0 0 0 0
  0 1 0 1 -1
 blue:
  0 0 0 0 0
  0 0 0 0 0
  0 0 0 0 1
  0 0 1 1 -1
and you will see that the weird aliasing effect just vanishes. Moreover, that way, the 'nudge RGB' filter recovers a totally symmetrical behavior compared to the 'nudge CMY' filter and everything is fine.

To reproduce, draw a white background with some rectangle. Then, draw a strokeless circle filled with black on top of it, and then apply the built-in filters 'nudge CMY' to the circle only. Put the flood-background opacity to 0 in the filter settings. Now, play with the alpha and the lightness of the black circle: you can see that the alpha has effect (OK), additionally there is no aliazing effect (OK).

Now, draw a black background with some rectangle. Then, draw a strokeless circle filled with white on top of it, and then apply the built-in filters 'nudge RGB' to the circle only. Put the flood-background opacity to 0 in the filter settings. Now, play with the alpha and the lightness of the white circle: you can see that the alpha has no effect (not OK), additionally the aliazing effect is present (not OK).

The proposed matrices above will solve both those issues regarding the 'nudge RGB' filter.

2) Offset issue with the 'nudge RGB' and 'nudge CMY' filters:

The 2 first offsets are (logically) applied to the source graphic while the third offset is (surprisingly) applied to the
blended results of the first 2 decomposed 'layers'. This is rather counter-intuitive. It seems more logical that the third offset also
applies to the source graphic (my filters just do that).

In addition to those 2 correction proposals, you are also free to maybe add the proposed chromatic aberration filters in some future release of Inkscape if you see some interest to it:

<https://inkscape.org/en/~fabien.fellay/%E2%98%85chromatic-aberration-filters>

Indeed, as long as the behavior with the alpha channel of the output according to the input lightness is different from the nudge RGB-CMY, those filters still bring something new.

Please, find attached to this report a file named 'Nudge_CMY-RGB_filters_issue.svg' demonstrating the above-mentioned topics.

Inkscape 0.92.2 (5c3e80d, 2017-08-06), Windows 10 64 bits

Tags: filters-svg
Revision history for this message
Fabien Fellay (fabien.fellay) wrote :
tags: added: filters-svg
Revision history for this message
Fabien Fellay (fabien.fellay) wrote :

Hello, any feedback? At least, is there someone who agrees (or not) with the above-mentioned small issues regarding the Inkscape built-in 'nudge RGB' filter?

description: updated
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.