Created
September 9, 2013 13:30
-
-
Save seyhunak/6495608 to your computer and use it in GitHub Desktop.
How to add a text caption to an image with MiniMagick and Ruby
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 'rubygems' | |
require 'mini_magick' | |
img = MiniMagick::Image.from_file("jpeg.jpg") | |
img.combine_options do |c| | |
c.gravity 'Southwest' | |
c.draw 'text 10,10 "whatever"' | |
c.font '-*-helvetica-*-r-*-*-18-*-*-*-*-*-*-2' | |
c.fill("#FFFFFF") | |
end | |
img.write("new.jpg") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what does the font means?? and how do I change font size??