Gimp can be used to convert SVGs with primitives (e.g. rects, circles, etc.) into a single path which can be used within HTML5.
- First download Gimp: https://www.gimp.org/downloads/
- Export your SVG as a
.svg
file with any tool of choice e.g. Illustrator. Don’t worry if the SVG output is messy for now, Gimp will clean it up - Import the SVG file into Gimp with File -> Open, and the following (or similar) dialog should show up:
Check both the Import Paths and Merge imported paths options
- Then go to Windows->Dockable Dialogues->Paths
- Right-click on the single path which says Imported Path and you should see the following dialog:
- Click Export Path… and save this text file to a location of your choice
- Locate and open up this file with a text editor of your choice e.g Notepad, TextEdit
- Copy the text within the
<path d="copy this text here" />
- Since Gimp formats the text with lots of spaces, you may need to re-format it, by removing some of the spaces to paste it into your HTML in a single line