Skip to content

Instantly share code, notes, and snippets.

@grough
Created March 6, 2012 19:30
Show Gist options
  • Save grough/1988486 to your computer and use it in GitHub Desktop.
Save grough/1988486 to your computer and use it in GitHub Desktop.
Generate animated gif with ruby + rmagick
require "rubygems"
require "rmagick"
include Magick
frames = 100
gif = ImageList.new
frames.times do |i|
colour = "#"; 3.times {
colour << "%02X" % (rand * 256)
}
gif << Image.new(130,50).color_fill_to_border(1, 1, colour)
end
gif.write("00-#{frames}-colours.gif")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment