Sha256: aebc73567a7a3d2a6ac496f5e1b712eec8329b49a4c13628ccabae6f779fcb21
Contents?: true
Size: 813 Bytes
Versions: 15
Compression:
Stored size: 813 Bytes
Contents
#! /usr/local/bin/ruby -w require 'RMagick' require 'date' # Demonstrate the Image#polaroid method img = Magick::Image.read('images/Flower_Hat.jpg').first img[:Caption] = "\nLosha\n" + Date.today.to_s begin picture = img.polaroid do self.font_weight = Magick::NormalWeight self.font_style = Magick::NormalStyle self.gravity = Magick::CenterGravity self.border_color = "#f0f0f8" end # Composite it on a white background so the result is opaque. background = Magick::Image.new(picture.columns, picture.rows) result = background.composite(picture, Magick::CenterGravity, Magick::OverCompositeOp) rescue NotImplementedError result = Magick::Image.read('images/notimplemented.gif').first result.resize!(img.columns, img.rows) end result.write('polaroid.jpg')
Version data entries
15 entries across 15 versions & 2 rubygems