Skip to content

Instantly share code, notes, and snippets.

@flakyfilibuster
Created October 26, 2012 07:05
Show Gist options
  • Save flakyfilibuster/3957340 to your computer and use it in GitHub Desktop.
Save flakyfilibuster/3957340 to your computer and use it in GitHub Desktop.
image_converter & caption!
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