1

I'm trying to convert some .ai files to .svg and the resulting SVGs only work in Inkscape itself. Not on GIMP or web browsers (they display a blank SVG)

Seems like the problem is that they don't support icc-color in the stroke attribute. How can I tell Inkscape to ignore this value?

Example of one of the paths:

<path
   d="M 0,0 C -0.811,1.082 -2.816,-0.186 -3.541,-0.653"
   style="stroke:#000000 icc-color(sRGB-IEC61966-2, 0.1, 0, 0, 0);" />

At the moment I used sed to separate icc-color from the rest of the stroke, but I'd like to have a less hacky way.

sed -i -e 's/icc-color/;icc-color/g' filename.svg
8
  • 1
    Hi. Welcome to GDSE. Looks to me like the problem here is the SVG path element is just off the page/viewbox (top left corner). That's why it's not showing up, and has nothing to do with the icc-colour profile. If you adjust the page to fit the element, then it will work in GIMP and browsers. I just tested it. I've no idea how to do this from the command line, but in Inkscape it's simple enough. Select all, and Edit > Resize page to selection.
    – Billy Kerr
    Commented Apr 17 at 15:13
  • I removed unnecessary parts in the example I showed. All paths have transform attribute and it brings them into the view. And I'm sure about icc-color issue, because when I put a ; before it to make a "valid" stroke, everything shows on the screen. Commented Apr 18 at 16:14
  • Share the problematic SVG here: svgshare.com - I can take a look. No promises though.
    – Billy Kerr
    Commented Apr 18 at 16:35
  • svgshare.com/s/15ZA, to make it show in browsers, add ; after each stroke:#000000 which turns it into: svgshare.com/s/15_R Commented Apr 19 at 17:44
  • 1
    That explains the weird construction: no closed paths, thousands of separate paths, and the clipping path mess. If you can, it's probably best to avoid CAD software or formats for vector graphics that are intended for the web (ie SVG). I know some often have ways to export as SVG, but they're not really designed for vector graphics. AI files are generally an Adobe Illustrator format, but that's not to say that they haven't been converted from something else originally. You might have more success using another intermediate format, such as PDF. Illustrator and Inkscape can both open PDFs.
    – Billy Kerr
    Commented Apr 22 at 10:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.