Skip to content

Instantly share code, notes, and snippets.

@wallymathieu
Created September 2, 2010 05:35
Show Gist options
  • Save wallymathieu/561920 to your computer and use it in GitHub Desktop.
Save wallymathieu/561920 to your computer and use it in GitHub Desktop.
smiley noise image
#!/usr/bin/ruby -w
require "rubygems"
require 'RMagick'
Text = ':)'
granite = Magick::ImageList.new('plasma:fractal') {self.size = "128x128"}
canvas = Magick::ImageList.new
canvas.new_image(128, 128, Magick::TextureFill.new(granite))
#canvas.rotate(45)
text = Magick::Draw.new
text.font_family = 'arial'
text.pointsize = 52
text.gravity = Magick::CenterGravity
#text.rotate(25)
#p text.methods
text.skewy(30).annotate(canvas, 0,0,2,2, Text) {
self.fill = 'gray83'
}.annotate(canvas, 0,0,-1.5,-1.5, Text) {
self.fill = 'gray40'
}.annotate(canvas, 0,0,0,0, Text) {
self.fill = 'black'
}
#canvas.write('smileynoise.jpg')
canvas.rotate(90).write('smileynoise.jpg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment