Shadow problem

Bug #1403613 reported by Andreas Pernlund
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Undecided
Unassigned

Bug Description

Hi!

I wonder what it is that gives me a gray square around the shade in inkscape but not in Illustrator and how to remove it if it is possible?

see attached files

My inkscape version is 0.48.5
Operating system is Windows 7

I am also including the SVG file.

Revision history for this message
Andreas Pernlund (andreas-pernlund) wrote :
Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Windows XP, Inkscape trunk rev. 13836.
(Batik, Opera and Firefox don't show the shadow at all).

Note that the shadow object is very complex, with lots of groups, masks and clipped path (the mask itself being composed of a lots of groups with clipped path and a bitmap image). Simplified version of the file attached (the shadow only shows with Inkscape).
Also note that there are easier methods to create a shadow with filters or even with a blurred copy of the object's contour.

Changed in inkscape:
status: New → Confirmed
Revision history for this message
jazzynico (jazzynico) wrote :
tags: added: clipping masking
Revision history for this message
su_v (suv-lp) wrote :

From the simplified test file:
    <mask
       id="mask3511"
       height="1"
       width="1"
       y="0"
       x="0"
       maskUnits="userSpaceOnUse">

From the SVG spec:
«maskUnits = "userSpaceOnUse | objectBoundingBox"
    Defines the coordinate system for attributes ‘x’, ‘y’, ‘width’ and ‘height’.
    If maskUnits="userSpaceOnUse", ‘x’, ‘y’, ‘width’ and ‘height’ represent values in the current user coordinate system in place at the time when the ‘mask’ element is referenced (i.e., the user coordinate system for the element referencing the ‘mask’ element via the ‘mask’ property).»

Removing the width/height and X/Y attributes from the mask definition (the used values seem to refer to a kind of normalized size of the masked object, or maybe to objectBoundingBox) makes the masked object getting rendered in other SVG viewers too (except librsvg which doesn't render Inkscape's masks either if those attributes are missing and 'maskUnits' are 'userSpaceOnUse'). IIRC Inkscape does not set these parameters itself when applying a mask (the spec defines fallback values for them when using 'userSpaceOnUse' for 'maskUnits' …).

A gray outer background instead of full transparency seems correct to me (though rendered too dark in Inkscape compared to other SVG viewers), since the embedded bitmap image doesn't use full black (which would render the masked area transparent) but some dark shade (#2d2c2e). Possibly there's a bug report about that already.

Note that the bitmap image lacks the attribute 'preserveAspectRatio="none"', so it renders differently scaled in other (compliant) SVG renderers and in Inkscape 0.91(pre3|+devel).

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

On 2015-01-05 13:33 (+0100), ~suv wrote:
> A gray outer background instead of full transparency seems correct to
> me (though rendered too dark in Inkscape compared to other SVG
> viewers), since the embedded bitmap image doesn't use full black
> (which would render the masked area transparent) but some dark shade
> (#2d2c2e). Possibly there's a bug report about that already.

Actually, Firefox and Chromium agree with Inkscape (once the attributes with the incorrect(?) values for the chosen maskUnits have been removed), and only Squiggle (Batik 1.7) renders the outer area of the applied mask in a much lighter shade of gray. Possibly a problem in Batik, or related to sRGB vs linearRGB (as discussed by Tav in the comments of bug #597974).

On 2015-01-05 13:33 (+0100), ~suv wrote:
> Note that the bitmap image lacks the attribute
> 'preserveAspectRatio="none"', so it renders differently scaled in
> other (compliant) SVG renderers and in Inkscape 0.91(pre3|+devel).

This is already tracked in earlier reports (bug #461467, bug #616717, bug #1357808).

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.