Skip to content

Instantly share code, notes, and snippets.

@Cosmo
Created April 4, 2015 10:24
Show Gist options
  • Save Cosmo/d71f37d1feeaecc43f6b to your computer and use it in GitHub Desktop.
Save Cosmo/d71f37d1feeaecc43f6b to your computer and use it in GitHub Desktop.
generate sequential images of numbers
require 'RMagick'
include Magick
width = 500
height = 500
start_color = "#333"
end_color = "#000"
fill = Magick::GradientFill.new(0, 0, height, height, start_color, end_color)
100.times do |t|
img = Magick::Image.new(width, height, fill)
title = Draw.new
title.annotate(img, 0, 0, 0, 0, t.to_s) {
self.gravity = CenterGravity
self.pointsize = 250
self.fill = 'white'
}
img.write("#{t}.png")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment