Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment