Skip to content

Instantly share code, notes, and snippets.

@jescalan
Created June 27, 2012 15:43
Show Gist options
  • Select an option

  • Save jescalan/3004929 to your computer and use it in GitHub Desktop.

Select an option

Save jescalan/3004929 to your computer and use it in GitHub Desktop.
image series > sprite
# This script runs through all the png images in a passed folder and sprites them
require 'fileutils'
puts "processing files..."
files = []
Dir["#{ARGV.first}/*.png"].each do |f|
files << f
end
system "if [ -e sprite.png ]; then rm sprite.png; fi"
system "convert #{files.join(" ")} -append sprite.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment