Incorrect Rendering Of Gradients At Offset 1

Bug #277155 reported by Triple Why
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Unassigned

Bug Description

I created this image with Inkscape 0.46 on Windows XP:
http://freenet-homepage.de/triplewhy/inkscape/bug/bsp.svg

It is a simple Rectangle with a linear gradient from red (offset = 0) to green (offset = 1) and blue (offset = 1) with an abrupt change. So it should look like this (rendered with Batik):
http://freenet-homepage.de/triplewhy/inkscape/bug/bsp-batik.png

But rendered with Inkscape, the blue part is missing:
http://freenet-homepage.de/triplewhy/inkscape/bug/bsp-inkscape.png

This only happens with two colors at offset 1. Offset 0 and any other offset with abrupt change is rendered correctly.

By the way there is another difference you may not notice in your browser: The png rendered by Batik has a transparent background, the rendering from Inkscape a white one. I set the background color to white in Inkscape, so white is what i would expect, but no other renderer I tried displayed it white...

Revision history for this message
Triple Why (yyy-unterderbruecke) wrote :
description: updated
tags: added: gradients renderer svg
Revision history for this message
Pablo Trabajos (pajarico) wrote :
Revision history for this message
Pablo Trabajos (pajarico) wrote :
Revision history for this message
Pablo Trabajos (pajarico) wrote :

I can confirm that the blue stop is not "blue" but more purplish. So my result is somewhat similar to the Batik result, however, I don't know which one is correct.

PS: Please, always attach files to the tracker. That way we've a guarantee that the files won't get lost.

Revision history for this message
Pablo Trabajos (pajarico) wrote :

It only happens when two stops share offset=1. If I use offset=0.5 for two stops of different color it works as expected producing an abrupt change.

Changed in inkscape:
status: New → Confirmed
tags: added: gradient
removed: gradients
Revision history for this message
jazzynico (jazzynico) wrote :

According to the SVG specs (http://www.w3.org/TR/SVG/pservers.html#GradientStops): "If two gradient stops have the same offset value, then the latter gradient stop controls the color value at the overlap point."

Thus the Batik behavior is correct, and the right half of the rectangle should be blue.

It is still incorrect in 0.48.4 (purple) but is fixed in the trunk (tested on Windows XP, Inkscape revision 12010).

Changed in inkscape:
importance: Undecided → Low
milestone: none → 0.49
status: Confirmed → Fix Committed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
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.