Colour change on blurred elements with a transform (regression in trunk)

Bug #1127103 reported by Cheeseness
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Tavmjong Bah

Bug Description

When a blurred element is transformed via a flip, rotate or shear, the colour of that element appears darker.

It does not happen when transforming an element inside a blurred group. Removing the blur reverts the element to its original colouring.

Steps to reproduce:
1) Launch inkscape with default prefs
2) Create a path (it's easier to see on filled paths)
3) Blur the path using the Fill and Stroke dialog's blur slider
4) Flip the path using the "Flip selected objects horizontally" toolbar button

Expected result:
The path should appear to be an exact mirrored version of its original form.

Actual result:
The fill and stroke of the flipped path is darker than its original colour.

Tested with Inkscape 0.48+devel r12044 on Fedora 17 32 bit.

Thanks to su_v for confirmation with other revisions (as far back as 11973) and additional assistance.

Revision history for this message
Cheeseness (cheeseness) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48+devel r12129 on OS X 10.7.4 (tested with cairo 1.12.2, and cairo 1.12.14)

Tests with archived builds:
- Not reproduced with revision <= 11965
- Reproduced with revision >= 11973

Likely introduced with changes between r11969-11972 (support for color-interpolation-filters = linearRGB):
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/changes/11973>

Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.49
status: New → Triaged
summary: - Colour change on blurred elements with a transform
+ Colour change on blurred elements with a transform (regression in trunk)
Cheeseness (cheeseness)
description: updated
Revision history for this message
su_v (suv-lp) wrote :

Adding another sample file which illustrates the difference whether the Gaussian blur was applied via Filter editor, or via Fill&Stroke

Steps:
1) draw a path
2) create two clones, flip one of the clones
3) blur the original path

Revision history for this message
su_v (suv-lp) wrote :
su_v (suv-lp)
tags: added: blocker
Revision history for this message
Jabiertxof (jabiertxof) wrote :

The problem is that the Fill&Stroke apply doesnt include the style color-interpolation-filters:sRGB to the filter element.

Jabiertxof (jabiertxof)
Changed in inkscape:
assignee: nobody → Jabiertxo Arraiza Cenoz (jabiertxof)
Revision history for this message
Jabiertxof (jabiertxof) wrote :

Fill&stroke blur slider bug fix

Changed in inkscape:
status: Triaged → In Progress
Revision history for this message
Jabiertxof (jabiertxof) wrote :

Im not sure to change the status to "fix commited" or not

Revision history for this message
su_v (suv-lp) wrote :

> Im not sure to change the status to "fix commited" or not

No, not yet - the bug status will be changed once a fix has actually been committed to trunk.

Revision history for this message
su_v (suv-lp) wrote :

Not sure where the proposed patch is the correct fix - to me it seems that the bug is in the rendering code (else Inkscape 0.49 will render old files considerably different than current stable 0.48.4, and also different than e.g. web browsers):

Please open attached sample file (created with Inkscape 0.48.4) first in stable Inkscape 0.48.4:
- all three objects have the same shade of grey
Now open the same file in current trunk (unpatched, or with Jabiertxo's patch applied - doesn't matter):
- the blurred object with a preserved transformation (a flipped clone of the blurred original) renders with a noticeably darker shade of grey.

Revision history for this message
Jabiertxof (jabiertxof) wrote : Re: [Bug 1127103] Re: Colour change on blurred elements with a transform (regression in trunk)

Thanks ~suv for the info.

El mar, 10-09-2013 a las 02:36 +0000, ~suv escribió:
> > Im not sure to change the status to "fix commited" or not
>
> No, not yet - the bug status will be changed once a fix has actually
> been committed to trunk.
>

Revision history for this message
Jabiertxof (jabiertxof) wrote :

Hi ~suv you are ok, the problem with old files persist if you open a "old" svg and dont touch the blur slider.
I think the best thing we can do is set a defautl render colorspace. ¿whats your opinion?

Revision history for this message
su_v (suv-lp) wrote :

On 2013-09-10 12:39 +0200, Jabiertxo Arraiza Cenoz wrote:> I think the best thing we can do is set a defautl render colorspace. ¿whats your opinion?

In my limited understanding, it looks like a math error in the renderer code for blurs on objects which have a (preserved) matrix transformation applied, or are inside a container (group) which has such a transform attribute applied (affects e.g. working with PDF files opened in Inkscape too - their initial layer is vertically flipped). I'm not a developer myself, and don't know whether to "set a defautl render colorspace" would address this (I was under the impression that Inkscape already does assume a default color space if not explicitly defined in the filter definition).

Revision history for this message
Jabiertxof (jabiertxof) wrote :

Hi ~suv i made the change for use sRGB instead linearRGB by default. Now the file opens OK but im not sure about others problems. Tav has some post about linearRGB in filters...

Revision history for this message
su_v (suv-lp) wrote :

@Jabiertxo - any chance you could create your patches with 'bzr diff' against trunk?

Revision history for this message
su_v (suv-lp) wrote :

Attaching patch from comment #13 formatted with 'bzr diff' against current trunk (r12504) for easier review and testing.

Revision history for this message
Jabiertxof (jabiertxof) wrote :

Sorry ~suv i lost remove a line here are the correct patch formatted with 'bzr diff'

Revision history for this message
Martin Owens (doctormo) wrote :

I've tested the patch and it's working with all the example files as well as the STRs. I'm going to leave the Linear colour space problem to the feature developers to sort out later, for now I've merged the patch and I'm posting this as Fixed Committed.

Changed in inkscape:
status: In Progress → Fix Committed
Revision history for this message
Martin Owens (doctormo) wrote :

Sorry: see r12530 for the merge.

Revision history for this message
su_v (suv-lp) wrote :

Attaching comparison of the rendering of the sample SVG filter effect
  <http://www.w3.org/TR/SVG/images/filters/filters01.svg>
with
1) current trunk r12579 (left)
2) current trunk r12579 with r12530 reverted (right)

Bottom row: montage (for easier comparison)

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

Revision 12590 should be a proper fix to this bug.

Revision history for this message
su_v (suv-lp) wrote :

@Jabiertxo, @Tav - thanks a lot to both of you for the time and efforts spent to fix this regression!

Changed in inkscape:
assignee: Jabiertxo Arraiza Cenoz (jabiertxof) → Tavmjong Bah (tavmjong-free)
tags: removed: blocker
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.