Created
May 28, 2009 05:17
-
-
Save necrodome/119106 to your computer and use it in GitHub Desktop.
give polarized effect to a photo
This file contains hidden or 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 polarize_photo(photo_url, photo_caption, pointsize = 14, font_family = 'Rufscript') | |
p = Image.read(photo_url)[0] | |
p[:Caption] = photo_caption | |
r = (-10..10).to_a[rand(20)] | |
p.polaroid(r) do | |
self.pointsize = pointsize | |
self.font_family = font_family | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment