Skip to content

mebusy/svg2imageset

Repository files navigation

svg2imageset

python3 script to convert SVG to iOS .imageset

Requirement

  1. python3.6+
  2. CairoSVG
    pip3 install cairosvg --user

Usage

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

Docker

Or just using the prebuilt docker image

$ docker run --rm -v `pwd`:/opt/svg2imageset/ mebusy/svg2imageset  test_arrow_circle_down.svg 60

About

python3 script to convert SVG to iOS .imageset

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published