python3 script to convert SVG to iOS .imageset
- python3.6+
- CairoSVG
pip3 install cairosvg --user
usage: python3 svg2imageset.py <path-2-svg> <icon-width> [outpath]
@ icon-width: specify the output width of the @1x png image
@ outpath: `.` by default
Example:
$ python3 ./svg2imageset.py test_arrow_circle_down.svg 60
I will generate such files...
test_arrow_circle_down.imageset
├── Contents.json
├── test_arrow_circle_down.png
├── test_arrow_circle_down_2x.png
└── test_arrow_circle_down_3x.png
Or just using the prebuilt docker image
$ docker run --rm -v `pwd`:/opt/svg2imageset/ mebusy/svg2imageset test_arrow_circle_down.svg 60