Batch resizing images

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
diab0lik
Posts: 2
Joined: 2015-04-30T05:03:26-07:00
Authentication code: 6789

Batch resizing images

Post by diab0lik »

Hi
I would like to batch resize a folder full of jpgs to do a slide show on my screen (1920x1080). i don't know much about programming I was wondering if someone could help me. The folder has a couple of hundred photos that i have scanned in that i would like to resize vertically to 1080 pixels (some are larger and some are smaller than 1080) but i would also like the rest of the image to be filled with black horizontally. Also if possible could the image sit on the left? thanks in advance for the help
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Batch resizing images

Post by snibgo »

You don't even say what type of computer you have. Windows, Mac, Arduino, IBM 360, DEC VAX?

This forum is happy to help with ImageMagick commands. For information or help about scripting, you should look elsewhere.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch resizing images

Post by fmw42 »

Please read the very top post on this forum at viewtopic.php?f=1&t=9620


mogrify can process a folder of images to resize and pad them. See http://www.imagemagick.org/Usage/basics/#mogrify

What version of Imagemagick are you using and on what platform? Syntax may differ. Are all the photos jpegs or mixed format? Do you want all the resulting image to be jpegs?

Try the following

Code: Select all

create a new empty folder (say folder2) so you do not walk over your original with an error

cd to folder desired (say folder1)

mogrify -path path2/folder2 -format jpg -resize 1920x1080 -gravity west -background black -extent 1920x1080 *.jpg
diab0lik
Posts: 2
Joined: 2015-04-30T05:03:26-07:00
Authentication code: 6789

Re: Batch resizing images

Post by diab0lik »

thanks fmw42. that worked. sorry i forgot to tell you the version of windows (7) and imagemagik 6.9.1-2-Q8.
Post Reply