Composition of two images, one with transparent background

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ikoop
Posts: 1
Joined: 2016-01-24T04:54:40-07:00
Authentication code: 1151

Composition of two images, one with transparent background

Post by ikoop »

Hey guys!

I've been struggling for a while with the following command:

I am trying to resize pictureA for the 60x40 format. Then, I want to place it on top of picutreB, keeping in mind that picutre B has a transparent background. So far I've tried the following:

composite -gravity center pictureA.jpg -resize 60x40^> picture2.png -background none test2.png

But this leaves the background of the test2.png Black...


Any ideas?


UPDATE:

I managed to got this working by:

composite -gravity center pictureA.png pictureB.png -background non test.png

where pictureA.png is pictureA.jpg converted. Can I include convert function within my composite?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Composition of two images, one with transparent background

Post by snibgo »

Please tell us the version of IM you are using, and the platform (Windows, unix, whatever). Diagnosis is also easier if you provide the images you are processing.

The problem might be cured with "-alpha set".

I would always use "convert" for this, not "composite".
snibgo's IM pages: im.snibgo.com
Post Reply