I'm trying to reduce the resolution of a large number of images using ImageMagick. The photos' original size is 5312 x 2988 pixels. The new dimensions should be 2000 x 1125 px.
Here is the command I'm using:
mogrify -path "C:\Users\Joe\Desktop\img\new" -resize 2000x1125 -auto-orient -format jpg -quality 75 "C:\Users\Joe\Desktop\img\*.jpg"
It works great for images that are in landscape mode. The problem is for images that are in portrait mode, with a resolution of 2988 x 5312 px. When I run the above command, their resulting size is 633 x 1125 px instead of 1125 x 2000.
Which command can I run that will produce, if the original image is 5312 x 2988, a resulting image of 2000 x 1125 (landscape). Or, if the original image is 2988 x 5312 (portrait), a resulting image of 1125 x 2000 pixels? It should be a single command since I have large number of images in a folder in both landscape and portrait modes.
Basically, the largest dimension should be 2000. If the photo is in landscape, the width should be 2000 px and the height should scale down proportionately. If the photo is in portrait mode, the height instead should be 2000 px.
-resize 2000
so the longest side comes out at 2000. – Mark Setchell