How to simplify SVG code?
Is it possible to simplify / clean up svg code by replacing the use-tags with s开发者_如何学JAVAtandard svg elements? Maybe an inkscape plugin? Haven't found anything...
Background: I'm converting some svgs to javafx graphics (.fxz) with javafx's production suite. And the tool doesn't understand the <use>
element.
Take a look at Scour - an SVG scrubber
Scour is an open-source Python script that aggressively cleans SVG files, removing a lot of 'cruft' that certain tools or authors embed into their documents. The goal of scour is to provide an identically rendered image (i.e. a scoured document should have no discernable visible differences from the original file).
They also have an extension for Inkscape as of v.48. To use it, go to "Save As.." and choose "Optimized .SVG. Be careful, and check your output, as I've found it can get too aggressive. Take these examples for instance, if they show up...
Good:
Bad:They claim to have and an online tool that does the same tricks... but as of 6/2011 it was not working. Hope this helps you clean up those often SCARY looking SVG's. Sometimes I feel like I'm the only one that realizes what this format is capable of!
精彩评论