Skip to content

Instantly share code, notes, and snippets.

@atduskgreg
Created December 9, 2015 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atduskgreg/007c9b5b50f9740a411d to your computer and use it in GitHub Desktop.
Save atduskgreg/007c9b5b50f9740a411d to your computer and use it in GitHub Desktop.
# resize an animated GIF
if ARGV.length < 3
puts "Usage:"
puts "ruby gif_prep.rb full_size.gif <size> small_size.gif"
exit
end
full = ARGV[0]
size = ARGV[1]
small = ARGV[2]
tmp_filename = "temp_#{full}"
`convert #{full} -coalesce #{tmp_filename}`
`convert temp_#{full} -resize #{size} #{small}`
`rm #{tmp_filename}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment