Vasia Pupkin
Vasia Pupkin

Reputation: 223

Append Images to PNG via Rmagick

for add text to image I'm doing next-

canvas = Magick::Image.read("init.png").first
gc = Magick::Draw.new
gc.pointsize(12)
gc.text(5, 207, params['property_type'])
gc.draw(canvas)
canvas.write("#tst.png")

How I can add images to exist picture(imposed from above)?

Upvotes: 2

Views: 1043

Answers (1)

Vasia Pupkin
Vasia Pupkin

Reputation: 223

I found solution.

canvas = Magick::Image.read("init.png").first
append_image =  Magick::Image.read('another.png').first
canvas.composite!(append_image, 0, 0, Magick::OverCompositeOp)

Upvotes: 3

Related Questions