How to add One Picture ontop of the other

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?".
Locked
CreativeCredent
Posts: 3
Joined: 2020-02-20T23:19:25-07:00
Authentication code: 1152

How to add One Picture ontop of the other

Post by CreativeCredent »

I Frequently have to edit Movie Posters for my movie collection and it takes time to Add the Media type bar to the top of the poster. I have to open Adobe XD and then drag the poster and then group them together and then export. So how do i use ImageMagick to combine two images together and make sure they come out 1000x1500

The first Image is the top media type bar
[Top Media Bar][https://imgur.com/a/sSpp0vf]

The second Image is the type of poster I'm trying to combine
[Movie Poster][https://imgur.com/a/3Kkt3Vr]

The Resulting Look Should be like so. At the top where it is rounded, needs to be transparent. On the hosted image it is black but it actually is transparent
[Result][https://imgur.com/a/TLHhuXw]

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to add One Picture ontop of the other

Post by fmw42 »

What is your Imagemgick version and platform, since syntax may vary?

You can simply append the two and save as png:

IM 6 syntax (for IM 7 replace convert with magick)

Code: Select all

convert header.png image.jpg -append result.png
However the combined image will be 1000x1600, not 1000x1500. So there is no way to do that if you want to preserver aspect ratio. You either have to distort the image to fit the desired size or you have to resize and crop or resize and pad. Which do you want to do?

CreativeCredent
Posts: 3
Joined: 2020-02-20T23:19:25-07:00
Authentication code: 1152

Re: How to add One Picture ontop of the other

Post by CreativeCredent »

My ImageMagick Version is 6.9.10-23 Q16. I Wouldn't mind cropping the poster top by 100px then adding the header bar to the top of the poster resulting in 1000x1500. I did just trying the -append and the result is that the top of the header where it is rounded shows the posters corners. If you look at the following photo at the top next to the two rounded corners you will see the poster corners poking through. [Corners Showing][https://imgur.com/a/pKsnpgI] When I create the image with my image editor i just use mask to hide the corners of the Poster

User avatar
GeeMack
Posts: 757
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: How to add One Picture ontop of the other

Post by GeeMack »

CreativeCredent wrote:
2020-02-22T22:09:03-07:00
I Wouldn't mind cropping the poster top by 100px then adding the header bar to the top of the poster resulting in 1000x1500.
To make the little rounded corners transparent you'll need to set the background color to "none". See if a command like this gets you close to what you want...

Code: Select all

convert header.png ( poster.jpg -chop 0x100 ) -background none -append result.png
That reads in the header image, then inside the parentheses it reads in the poster image and chops 100 pixels off the top. After setting the background to "none", append the header and poster on a transparent background.

If you're on a *nix OS you'll probably need to escape those parentheses with backslashes "\(...\)".

CreativeCredent
Posts: 3
Joined: 2020-02-20T23:19:25-07:00
Authentication code: 1152

Re: How to add One Picture ontop of the other

Post by CreativeCredent »

That worked Great thanks for you're help.

Locked