Why is the svg black and white?


Question

Someone edited my svg file and now, if I import it into Scribus 1.5.1, It is only black, all colors are gone.

This is the commit at github, where the format of the svg changed.

before, It was all in color. The new version is in color, if you open it in Inkscape or even in Browser: (save this and open in Firefox)

Only Scribus seems to loose the colors.

I did a workaround and exported it to png before importing it in my scribus project, but still, I would like to understand the problem.

1
1
8/25/2015 12:58:00 PM

It seems to be an issue with the nested groups. If you open the newer file in Inkscape, while you can see the colors, if you click any of the objects, you'll see "Paint is undefined" in the `Fill and Stroke window.

A simple fix is to simply remove the extraneous groups.

  1. Open the file in Inkscape.
  2. Press Ctrl+A to select everything.
  3. Press Ctrl+Shift+G to ungroup.
  4. Click one of the colored objects and verify that its fill color shows up in the Fill and Stroke (Ctrl+Shift+Shift+F). If it still says "Paint is undefined" try ungrouping 1 or 2 more times.

As you might have noticed, Scribus is a little more strict about the features used in an SVG graphic. Most SVG editors have special features in SVG files in their own namespace that Scribus doesn't understand. Inkscape can "figure it out" in this case and show the correct color, but Scribus couldn't. To debug this type of thing, I usually open the SVG in Inkscape with the XML view and walk through the image. Usually the root cause is some hinky XML in the file that can usually be removed. Saving as "Plain SVG" from Inkscape can also sometimes help (but didn't work in this case).

(Tested with Scribus 1.4.5 and Inscape 0.91)

1
8/31/2015 1:24:00 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow


Website under construction!!!
^