Skip to content

Instantly share code, notes, and snippets.

@RobertAudi
Created July 15, 2013 17:42
Show Gist options
  • Save RobertAudi/6001881 to your computer and use it in GitHub Desktop.
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
brew install imagemagick
# 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: 'Icon-72@2x.png', size: 144 },
{ name: 'Icon-Small-50.png', size: 50 },
{ name: 'Icon-Small.png', size: 29 },
{ name: 'Icon-Small@2x.png', size: 58 },
{ name: 'Icon.png', size: 57 },
{ name: 'Icon@2x.png', size: 114 },
].each do |v|
output = output_dir_path + v[:name]
command = "convert -resize #{v[:size]} #{input} #{output}"
puts command
system command
end
end
rake create_icons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment