Created
July 15, 2013 17:42
-
-
Save RobertAudi/6001881 to your computer and use it in GitHub Desktop.
Automatically Create Icons for iOS Apps. Full credits to Yuya Kitajima (aka @yuyak on Github) for this rake task, shared as a Coderwall tip. https://coderwall.com/p/otmx2g
This file contains hidden or 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
brew install imagemagick |
This file contains hidden or 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
# coding: utf-8 | |
desc 'Create icons' | |
task :create_icons do | |
# Source icon filename | |
input = 'Icon-1024.png' | |
output_dir_path = 'Images/' | |
[ | |
{ name: 'Icon-72.png', size: 72 }, | |
{ name: '[email protected]', size: 144 }, | |
{ name: 'Icon-Small-50.png', size: 50 }, | |
{ name: 'Icon-Small.png', size: 29 }, | |
{ name: '[email protected]', size: 58 }, | |
{ name: 'Icon.png', size: 57 }, | |
{ name: '[email protected]', size: 114 }, | |
].each do |v| | |
output = output_dir_path + v[:name] | |
command = "convert -resize #{v[:size]} #{input} #{output}" | |
puts command | |
system command | |
end | |
end |
This file contains hidden or 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
rake create_icons |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment