Created
April 4, 2015 10:24
-
-
Save Cosmo/d71f37d1feeaecc43f6b to your computer and use it in GitHub Desktop.
generate sequential images of numbers
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 '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