Page 2 of 2

Re: Quickly merging 2 select files side by side through windows context menu?

Posted: 2018-02-06T22:36:51-07:00
by snibgo
"+append" appends horizontally. "-append" appends vertically. You would adjust the width instead of the height:

Code: Select all

-resize "%%[fx:max(u.w,v.w)]x"
The "-resize" normally takes two numbers, like 23x34. for width and height. You are supplying only one, so IM calculates the other.

Re: Quickly merging 2 select files side by side through windows context menu?

Posted: 2018-02-06T23:42:30-07:00
by ericpa06
snibgo wrote: 2018-02-06T22:36:51-07:00 "+append" appends horizontally. "-append" appends vertically. You would adjust the width instead of the height:

Code: Select all

-resize "%%[fx:max(u.w,v.w)]x"
The "-resize" normally takes two numbers, like 23x34. for width and height. You are supplying only one, so IM calculates the other.
Image

Re: Quickly merging 2 select files side by side through windows context menu?

Posted: 2018-02-07T09:50:34-07:00
by fmw42
Is there a question here?

Re: Quickly merging 2 select files side by side through windows context menu?

Posted: 2018-02-07T16:39:41-07:00
by ericpa06
fmw42 wrote: 2018-02-07T09:50:34-07:00 Is there a question here?
Ok, since you asked.. I'm trying to not abuse of you guy's patience but... would it be possible to automatically, instead of just merging them and keeping their original height or width, to create a new image with a height and width already defined, and to merge them side by side in it?

To be more clear and to explain me better, I would selecte two images, and to create a new image with them side by side and split in half, with resolution of, let's say "1000X400", and I would like to centralize each image inside its respective square/parts?

Something like this:
Image

Instead of this:
Image

Re: Quickly merging 2 select files side by side through windows context menu?

Posted: 2018-02-07T17:07:30-07:00
by fmw42
That is possible, but it means cropping one or both images to fit the half width. I presume you mean that the appended image is to be 1000X400? Is that correct?

Try this:

Code: Select all

convert image1.jpg image2.jpg -resize "500x400^" -gravity center -crop 500x400+0+0 +repage -bordercolor white -border 2 +append result.jpg
or

Code: Select all

convert image1.jpg image2.jpg -resize "500x400^" -gravity center -extent 500x400 -bordercolor white -border 2 +append result.jpg
Change the names of the images for your purposes.

See
https://www.imagemagick.org/script/comm ... p#geometry
https://www.imagemagick.org/Usage/thumbnails/#cut

Re: Quickly merging 2 select files side by side through windows context menu?

Posted: 2018-02-08T03:51:09-07:00
by ericpa06
Thank you so much, it worked perfectly!

Re: Quickly merging 2 select files side by side through windows context menu?

Posted: 2018-02-09T11:18:57-07:00
by ericpa06
So... that first script, would it be possible to make it to merge two gif files side by side?

"magick %1 %2 -resize "x%%[fx:max(v.h,u.h)]" +append file.png"

I tried to twerk it a little bit (like changing the command to ".gif"), but it ended up combining all the images inside each gif side by side, instead of something like this:

Image

Re: Quickly merging 2 select files side by side through windows context menu?

Posted: 2018-02-09T11:47:54-07:00
by fmw42
Snibgo's method may have trouble if the number of frames and frame delays are different. See https://www.imagemagick.org/Usage/anim_mods/#merging