Created
October 26, 2012 07:05
-
-
Save flakyfilibuster/3957340 to your computer and use it in GitHub Desktop.
image_converter & caption!
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 | |
def image_reformatting(input_image) | |
img = Magick::Image.read(input_image)[0] | |
img.format = "png" | |
img.write("format.png") | |
text = Draw.new | |
img.annotate(text, 0,0,0,0, "Puppies code on the weekend too."){ | |
text.gravity = Magick::SouthGravity | |
text.pointsize = 28 | |
text.fill = "#FFFF" | |
} | |
img.write("changed.png") | |
end | |
image_reformatting("puppies.jpg") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment