What's wrong with my commands?

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
sindark87
Posts: 2
Joined: 2018-02-14T13:11:45-07:00
Authentication code: 1152

What's wrong with my commands?

Post by sindark87 »

So, I just discovered ImageMagick and I'm using it from windows command line. I'm trying to join a bunch of pictures side to side in a single file. Some of the images need to be flipped horizontally, some vertically. My command joins the images, some images gets flipped or flopped, but some don't; I can't figure out the pattern in what's happening, it's weird. This is the way I'm doing it (in this example I want to join four images in a row after flipping the first two horizontally and the second two vertically):

imagemagick.exe convert One.jpg -flop Two.jpg -flop Three.jpg -flip Four.jpg -flip +append Output.jpg

It seems this should be a simple task, any tips as to what I'm doing wrong?

Thanks:)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: What's wrong with my commands?

Post by snibgo »

"-flop" operates on all the images in the current list. Same with "-flip". So some of your images get flopped twice, etc.

The cure is to use parentheses:

Code: Select all

imagemagick.exe convert ( One.jpg -flop ) ( Two.jpg -flop ) ( Three.jpg -flip ) ( Four.jpg -flip )  +append Output.jpg
snibgo's IM pages: im.snibgo.com
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: What's wrong with my commands?

Post by Bonzo »

Just beat me to it snibgo

Also if you allowed Imagemagick to add itself to the environmental variable path you do not need imagemagick.exe and if you are using V7 it now uses magick rather than convert
sindark87
Posts: 2
Joined: 2018-02-14T13:11:45-07:00
Authentication code: 1152

Re: What's wrong with my commands?

Post by sindark87 »

Ah, of course, that's what's happening! Thank you guys, that's a lot of helpful information... until now I didn't even know about environmental variabels😁
Post Reply