Skip to content

Instantly share code, notes, and snippets.

@elvuel
Created November 12, 2012 03:25
Show Gist options
  • Save elvuel/4057324 to your computer and use it in GitHub Desktop.
Save elvuel/4057324 to your computer and use it in GitHub Desktop.
Using mini_magick(IM) draw text with shadow effect
# encoding: utf-8
require 'mini_magick'
image = MiniMagick::Image.open('blank.jpg')
image.combine_options do |c|
c.gravity 'Center'
c.pointsize '22'
c.draw "text 3,3 'Ruby'"
c.fill 'blue'
c.draw "text 0,0 'Ruby'"
c.fill 'gray'
end
image.write('text_with_shadow_spike.jpg')
puts "ok"
@mungojelly
Copy link

Yay thanks, I just used this as a hello world to test out mini_magick for http://github.com/mungojelly/polyglot-etude :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment