Recursively resize all images in folder to same resolution ?

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
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Recursively resize all images in folder to same resolution ?

Post by Rye »

So, I am under Windows and currently have the following problem.


I have a folderstructure like this:

FOLDER
|
ARTS
|
ORIGINAL
|
---- f01
|
----- f02
.
.

I want to recursively resize all images in that folder to the same resolution.


Can this easily be done with imagemagick ?

Thanks in advance
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Recursively resize all images in folder to same resolution ?

Post by fmw42 »

The mogrify command will resize each image in one directory -- one output for each input in the directory. So you would likely need to write a script to loop over each directory and use mogrify. Alternately, you would have to write a script to loop over each image in each directory and use the convert command. Perhaps one of the Windows users can give you better pointers. But Imagemagick by itself does not deal with recursive directories.
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Recursively resize all images in folder to same resolution ?

Post by Rye »

Too bad... Thanks anyways
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Recursively resize all images in folder to same resolution ?

Post by Rye »

Well... Assuming we *were* under unix, how'd the command look here ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Recursively resize all images in folder to same resolution ?

Post by glennrp »

You could do

Code: Select all

for x in `find . -type d`
 do
 (cd $x; mogrify ....)
 done
Post Reply