14

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
8
  • try to double the percentage symbol Commented Jul 25, 2014 at 7:18
  • What does "it is not working" mean? Commented Jul 25, 2014 at 7:50
  • File size is not reducing Commented Jul 25, 2014 at 8:11
  • When i used double (mogrify -path \images-rep -strip -interlace Plane -gaussian-blur 0.05 -quality 66%% *.jpg) also not working Commented Jul 25, 2014 at 8:11
  • Is there any other way to reduce image size using mogrify Commented Jul 25, 2014 at 8:15

3 Answers 3

18

Use this command to convert your batch of images under a folder

   mogrify -path imagepath  -strip -quality 50% *.jpg
Sign up to request clarification or add additional context in comments.

1 Comment

this renames the files too, which means it does not preserve image name.
3

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

Comments

2

Reduce the depth of the image will reduce the size of the image

-depth 5

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.