Code: Select all
for filename in *.jpg; do
magick "$filename" -gravity Center -background White -extent "%[fx:max(w,h)]x%[fx:max(w,h)]" "converted-$filename"
done
I came across using a FOR /R loop as a possible solution, but am not sure how to merge this into the code I'm currently using? I'd need it to process images in sub-directories and maintain the folder structure (i.e. not move process images to the root folder).
Apologies if this is a rather simple question, but I'm quite new to ImageMagick and command line image processing! Thanks for bearing with me...