I need to convert batch of .jpg images filesize using image magick. am able to convert a single file using the following code
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 65% 1.jpg result.jpg
I need to do this convert for a batch of images. i tried this but it is not working
mogrify -path \images-rep -strip -interlace Plane -gaussian-blur 0.05 -quality 66% *.jpg
To resize an image to specific dimensions, use the convert command with an input file, the -resize parameter, your preferred dimensions, and an output filename: convert original. png -resize 100x100 new. png.
Use this command to convert your batch of images under a folder
mogrify -path imagepath -strip -quality 50% *.jpg
To specify a maximum file size, mogrify -define jpeg:extent=300kb *.jpg
. However, this can be much slower than just -quality 50%
and/or -resize 50%
. https://stackoverflow.com/a/11920384/2097284
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With