Save to EMF loses fill color (pattern fill)

Bug #928224 reported by RuiDC
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Medium
Unassigned

Bug Description

original SVG file (prob.svg) produced using matplotlib - which generated invalid SVG (duplicate id's)

However, even after opening and re-saving as Inkscape SVG (produced valid SVG), saving as EMF using inkscape.exe or exporting inkscape.com
causes fill color to be lost (prob_ink.*)

Using 0.48.2 on Windows XP SP3

python code to reproduce original SVG file attached (requires matplotlib)

Revision history for this message
RuiDC (ruidc) wrote :
Revision history for this message
RuiDC (ruidc) wrote :

... also saving to PNG from the prob_ink.svg also produces incorrect result - partially filled color

Revision history for this message
RuiDC (ruidc) wrote :

note that even with the following matplotlib patch applied that produces valid SVG, this is still an issue.
https://github.com/matplotlib/matplotlib/pull/696

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

> ... also saving to PNG from the prob_ink.svg also
> produces incorrect result - partially filled color

'File > Export bitmap…' produces PNG files which look the same as the provided SVG files in Inkscape 0.48.2

(Note: don't save as 'Cairo PNG' for high-quality rasterized bitmap images).

tags: added: emf exporting win32
su_v (suv-lp)
tags: added: pattern
summary: - Save to EMF loses fill color
+ Save to EMF loses fill color (pattern fill)
Revision history for this message
RuiDC (ruidc) wrote :

>> ... also saving to PNG from the prob_ink.svg also
>> produces incorrect result - partially filled color

was indeed referring to 'Cairo PNG', confirm that export as bitmap works fine.

vector formats seem to have incorrect results, rasterized formats seem to work

Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Windows XP, Inkscape trunk revision 11721, with the files attached comment #1.

Since the SVG file uses clippaths, the issue could be related to (or duplicate of) Bug #649744 "emf wmf export clipping path issue" <https://bugs.launchpad.net/inkscape/+bug/649744>.

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
David Mathog (mathog) wrote :

The issue here is that the objects are not filled with a solid color, gradient, or bitmap, but by an SVG pattern.

SVG patterns consist of a series of vector operations, in this example, the patterns are red or blue rectangles with black edges. When saving to another vector format, like EMF, these must be converted to something else, since few of the other vector formats support an SVG like fill (fill with more vector operations, PDF being the one exception that I know of.) For EMF not even the lp988601 branch can do this. To do so it would have to render the "core" SVG pattern into a bitmap. Since the pattern can be quite a complex piece of SVG this is not trivial. If somebody can point me to an existing Inkscape function that renders patterns into bitmaps I will implement this for EMF export.

In the meantime, the "fix" here is to get rid of the pattern fill. For instance, select the red bar, change it from a pattern to a solid fill, then do the same for the blue.

Or in the original generator, draw the long graph bars as solids, and draw the squares, if they are really needed, over them. Not as a pattern, but as actual squares.

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.