Koozer
Koozer

Reputation: 117

rotate and then merge two images with Imagemagick 7.0.4-3-Q16

I'm trying to rotate a pair of images, one 90 and one -90, and then stitch them horizontally. I can do both separately, but for reasons I don't understand the following falls over:

magick montage (magick convert "J:\img1.jpg" -rotate 90) (magick convert "J:\img2.jpg" -rotate -90) -geometry +0+0 "J:\imgout.jpg"

I get the error:

convert:  `90' @ error/convert.c/ConvertImageCommand/3251.

Removing the magick convert parts gives a different error:

You must provide a value expression on the right-hand side of the '-' operator.

Upvotes: 1

Views: 948

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207465

This should be easier:

convert 1.png -rotate 90 2.png -rotate -90 +append result.png

As @Bonzo suggests, if running ImageMagick v7+, replace convert with magick:

magick 1.png -rotate 90 2.png -rotate -90 +append result.png

Given 1.png and 2.png:

enter image description here

enter image description here

You will get

enter image description here

Upvotes: 2

Related Questions