I have a bunch of SVG files that contain <image> tags which link to other SVG files.

I'd like to replace these <image> tags with the contents of the files they are linked to. In other words, directly include the SVG code into the master SVG file, instead of linking to outside dependencies.

I can do this manually, using a text editor, replacing each <image> tag with a <g> tag, adding transform="translate()" attribute and copying and pasting code from the linked file. However, given the number of files I need to edit, that approach is completely impractical. Is there a command line tool that does that automatically?


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.