Quickly merging 2 select files side by side through windows context menu?
Quickly merging 2 select files side by side through windows context menu?
So... I was wanting to create a command to quickly merge two selected images side by side (automatically adjusting their height, if there's any diference), and merging them. For instance, I would select two images in the desktop and merge them. It seems that it's possible to do this using Windows "Send To" and ImageMagick, but I don't know
Please, I don't understand anything about commands and stuff, so go easy about the technical stuff. I'm using Windows 10. Something like this:
[Before]
[Later]
Please, I don't understand anything about commands and stuff, so go easy about the technical stuff. I'm using Windows 10. Something like this:
[Before]
[Later]
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Quickly merging 2 select files side by side through windows context menu?
What version of ImageMagick?
If using IM 7, then in unix syntax
For Windows, you may need to double the % to %%,. I am not a windows user so I may be wrong about this.
For IM 6, you must calculate the the resize argument separately first and store in a variable.
Sorry I do not know the equivalent for Windows syntax.
If using IM 7, then in unix syntax
Code: Select all
magick image1 image2 -resize "x%[fx:max(u.h, v.h)]" +append result
For IM 6, you must calculate the the resize argument separately first and store in a variable.
Code: Select all
ht=`convert image1 image2 -format "%[fx:max(u.h, v.h)]\n" info: | head -n 1`
convert lena.png monet2.jpg -resize "x$ht" +append result
Re: Quickly merging 2 select files side by side through windows context menu?
I'm using version 7.0. What should I do with this comandy exactly?
"magick image1 image2 -resize "x%%[fx:max(u.h, v.h)]" +append result"
I tried to creat a bat file with it and put it "Send to", but it doesn't seem to be work. Or at least, it's not working as I imagine, to explain better what I would like to do:
https://i.imgur.com/n1HSPxw.gifv
Thank you.
"magick image1 image2 -resize "x%%[fx:max(u.h, v.h)]" +append result"
I tried to creat a bat file with it and put it "Send to", but it doesn't seem to be work. Or at least, it's not working as I imagine, to explain better what I would like to do:
https://i.imgur.com/n1HSPxw.gifv
Thank you.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Quickly merging 2 select files side by side through windows context menu?
Your error message appears then vanishes. Put a "pause" in your script, then copy-paste the error message here.
snibgo's IM pages: im.snibgo.com
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Quickly merging 2 select files side by side through windows context menu?
Where Fred put "image1" and "image2", it needs the filenames of your images. As you are using a BAT file, you can put "%1" and "%2" (with no quotes).
Also, for "result" put an output filename, like "out.png".
Also, for "result" put an output filename, like "out.png".
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Quickly merging 2 select files side by side through windows context menu?
Sorry, I should have made it more clear about the filenames for image1 and image2 and result.
Re: Quickly merging 2 select files side by side through windows context menu?
Ok, I made the adjustments that you guys said, the script it's now able to recognize the name of the files that I selected, but the following message is appearing:
It's seems that it's a problem with the resize specifications, probably something that I didn't specified.
The current bat file is like this:
magick %1 %2 -resize "x%[fx:max(u.h, v.h)]" + file.png
(Sorry being taking your time ]
It's seems that it's a problem with the resize specifications, probably something that I didn't specified.
The current bat file is like this:
magick %1 %2 -resize "x%[fx:max(u.h, v.h)]" + file.png
(Sorry being taking your time ]
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Quickly merging 2 select files side by side through windows context menu?
I do not know window bat scripting but there is something about doubling % to %%. But I am not sure which ones need doubling. The ones for %1 and %2 or the one for "x%[fx:max(u.h, v.h)]" or neither. But remove the + sign. ImageMagick syntax does not use that.
See https://www.imagemagick.org/Usage/windows/ for syntax differences.
See https://www.imagemagick.org/Usage/windows/ for syntax differences.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Quickly merging 2 select files side by side through windows context menu?
In the BAT file, %1 and %2, the "%" symbols have special meanings to the shell interpreter, so they are fine. But we don't want the special meaning for the "%" in "x%%[fx:max(u.h,v.h)]", so double that one.
For "+", you should have "+append".
For "+", you should have "+append".
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Quickly merging 2 select files side by side through windows context menu?
Good catch. I completely missed that.
Re: Quickly merging 2 select files side by side through windows context menu?
Ok, we are getting closer. The problem seems be with that "-resize "x%%[fx:max(u.h,v.h)]" part, I tried without it, and it worked like a charm, but it didn't resized the image, of course.
https://i.imgur.com/UEOcktG.png
When I tried with the resize command:
magick %1 %2 -resize "x%%[fx:max(u.h,v.h)] +append file.png
It didn't work, this error appeared, saying "Missing Argument"
https://i.imgur.com/yvhNIP8.png
https://i.imgur.com/UEOcktG.png
When I tried with the resize command:
magick %1 %2 -resize "x%%[fx:max(u.h,v.h)] +append file.png
It didn't work, this error appeared, saying "Missing Argument"
https://i.imgur.com/yvhNIP8.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Quickly merging 2 select files side by side through windows context menu?
You have one quote. Quotes normally come in pairs.
snibgo's IM pages: im.snibgo.com
Re: Quickly merging 2 select files side by side through windows context menu?
Just a little last question, and I promise I stop bothering you guys... what if I wanted to merge two images one above the other and do this same resizing?