Skip to content

Instantly share code, notes, and snippets.

@necrodome
Created May 28, 2009 05:17
Show Gist options
  • Save necrodome/119106 to your computer and use it in GitHub Desktop.
Save necrodome/119106 to your computer and use it in GitHub Desktop.
give polarized effect to a photo
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