Skip to content

Instantly share code, notes, and snippets.

@printercu
Created January 24, 2017 18:36
Show Gist options
  • Save printercu/acfab697cb4c9741d1ce318055c53e1b to your computer and use it in GitHub Desktop.
Save printercu/acfab697cb4c9741d1ce318055c53e1b to your computer and use it in GitHub Desktop.
Convert svg images to multiple dimensions.
#!/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