Skip to content

Instantly share code, notes, and snippets.

@dLobatog
Created June 13, 2012 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dLobatog/2921455 to your computer and use it in GitHub Desktop.
Save dLobatog/2921455 to your computer and use it in GitHub Desktop.
Put sticker
def put_sticker(sticker, x, y)
photo_path = photo.file_path
loot_image = Magick::Image::read(photo_path)[0]
sticker_image = Magick::Image::read(sticker)[0]
loot_image = loot_image.composite(sticker_image, x, y, Magick::AtopCompositeOp)
out = photo_path.sub(/\./, "-sticker.")
loot_image.format = "PNG"
loot_image.write(out)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment