Skip to content

Instantly share code, notes, and snippets.

@alexsoble
Forked from grough/00-100-colours.gif
Last active August 29, 2015 14:07
Show Gist options
  • Save alexsoble/7f17c03fe063e1d93a9a to your computer and use it in GitHub Desktop.
Save alexsoble/7f17c03fe063e1d93a9a to your computer and use it in GitHub Desktop.
Make beautiful gifs out of your pictures, using the magick of Ruby
require "rubygems"
require "rmagick"
require "fileutils"
include Magick
jpgs = Dir["*.jpg"]
gif = ImageList.new
jpgs.each do |j|
img = Image.read(j)[0]
gif << img
end
beautiful_gif = "beautiful-gif.gif"
if File.exist?(beautiful_gif)
FileUtils.rm_r(beautiful_gif)
end
gif.delay = 20
gif.write(beautiful_gif)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment