Page 1 of 1

How to add One Picture ontop of the other

Posted: 2020-02-20T23:36:18-07:00
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]

Re: How to add One Picture ontop of the other

Posted: 2020-02-21T00:00:22-07:00
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?

Re: How to add One Picture ontop of the other

Posted: 2020-02-22T22:09:03-07:00
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

Re: How to add One Picture ontop of the other

Posted: 2020-02-22T23:08:33-07:00
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 "\(...\)".

Re: How to add One Picture ontop of the other

Posted: 2020-02-23T16:28:48-07:00
by CreativeCredent
That worked Great thanks for you're help.