Page 1 of 1

Want to loop this script for all files in a folder

Posted: 2016-04-01T05:04:36-07:00
by joshuafinny
Script: convert image.jpg -fuzz 5% -fill #f1f0ee -opaque white -resize 720x1125 -background #f1f0ee -gravity center -extent 720x1125 output.jpg
Platform: Windows
Imagemagick Version: 6.9.3

How do I loop this script to run on all images in a folder? I want the input and output images to be in separate folders.

Re: Want to loop this script for all files in a folder

Posted: 2016-04-01T05:09:26-07:00
by snibgo
See documentation for your script language. Hint: "help for".

Re: Want to loop this script for all files in a folder

Posted: 2016-04-01T10:48:36-07:00
by fmw42
see mogrify at http://www.imagemagick.org/Usage/basics/#mogrify

create a new directory (test2)
cd to your existing image directory (test1)

Code: Select all

mogrify -path path2/test2 -format jpg -fuzz 5% -fill "#f1f0ee" -opaque white -resize 720x1125 -background "#f1f0ee" -gravity center -extent 720x1125 *
On unix, quotes are required about hex colors.