A
A
Artyom Lagun2014-02-25 12:09:17
Ruby on Rails
Artyom Lagun, 2014-02-25 12:09:17

How to stitch photos on Rails 3?

There was such problem: there is a photo loaded by the user. On the site, another picture is superimposed on it (the same one for all the pictures.). How to make it so that you can download a photo + picture as one?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
@
@mgyk, 2014-02-25
_

https://github.com/minimagick/minimagick

image = Image.open("original.png")
result = image.composite(Image.open("watermark.png", "jpg")) do |c|
  c.gravity "center"
end
result.write "my_output_file.jpg"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question