-
-
Save alexsoble/7f17c03fe063e1d93a9a to your computer and use it in GitHub Desktop.
Make beautiful gifs out of your pictures, using the magick of Ruby
This file contains 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
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