Batch resize images and output images to new folder with ImageMagick
Solution 1:
"Mogrify" should be called from the directory with the original thumbnails, while the -path parameter is for pointing target directory.
cd public_html/images/thumbs
magick mogrify -resize 16x12 -quality 100 -path ../new-thumbs *.jpg
http://www.imagemagick.org/Usage/basics/#mogrify
the last arguments are the list of files, so you can filter by name pp*.jpg for example.
Solution 2:
Suggested solutions do not work properly on the latest ImageMagick (at least, on macOS). Command, that works overwriting source images is as follows:
magick mogrify -path ./ -resize 50% -quality 80 *.jpg
To avoid overwriting the original images, write to a new folder:
magick mogrify -path path/to/destination/folder/ -resize 50% -quality 80 *.jpg
Solution 3:
In ImageMagick 7 versions its built into the magick ...so..
magick mogrify -resize 16x12 -quality 100 -path ../new-thumbs *.jpg
Make sure that the folder you specify in path exists. It will not be created by ImageMagick.
Find more information here https://www.imagemagick.org/script/mogrify.php
Solution 4:
For those having Shotwell installed on Ubuntu/Debian, following may be more easy to export selected images in a folder to another folder through processing the images as needed.
- Open Shotwell
- Select the images you want to export
- File > Export
- Adjust the values to your needs
- Select the folder to export