Created
January 24, 2017 18:36
-
-
Save printercu/acfab697cb4c9741d1ce318055c53e1b to your computer and use it in GitHub Desktop.
Convert svg images to multiple dimensions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# For some/file.svg run: | |
# | |
# script some/file | |
# | |
# Requirement for mac os: | |
# | |
# brew cask install inkscape | |
file = ARGV[0] | |
%w(48 60 72 76 96 120 152 180 192 512 1200).each do |res| | |
run "inkscape -zT -f #{file}.svg -w #{res} -h #{res} --export-png #{file}-#{res}x#{res}.png" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment