Guest User

Untitled

a guest
Oct 19th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def put_sticker(sticker, x, y)
  2. photo_path = photo.file_path
  3. loot_image = Magick::Image::read(photo_path)[0]
  4. sticker_image = Magick::Image::read(sticker)[0]
  5. loot_image = loot_image.composite(sticker_image, x, y, Magick::AtopCompositeOp)
  6. out = photo_path.sub(/\./, "-sticker.")
  7. loot_image.format = "PNG"
  8. loot_image.write(out)
  9. end
Add Comment
Please, Sign In to add comment