Reputation: 1581
I am using imagemagick to resize images... however I want to resize the images so that it uses both jpeg:extent and quality...
i.e. if I have a large image that i want to resize, and I use the following:
-resize 720 -quality 80
if the resulting image is larger than 250kb then I want the command to use jpeg:extent=250kB
instead of -quality 80
Is this possible to do in one command?.. or do I have to do multiple proceedures to achieve this?... regards J
By the by, I dont want to just use jpeg:extent=250kB
as if the image saved at 80% quality is alot smaller than 250kb i am creating images larger than they need be... cheers J
Upvotes: 1
Views: 1073
Reputation: 1708
You can use both options at the same time. According to documentation:
Restrict the maximum JPEG file size, for example -define jpeg:extent=400kb.
This command doesn't define the actual size, it only defines a size limit. This means that quality will be 80 if the size limit is not reached
Upvotes: 1