Page 1 of 1

Maximum size jpeg

Posted: 2014-11-03T05:46:09-07:00
by karlmistelberger
When resizing I use the following command:

Code: Select all

convert -distort resize 800x -strip -quality 70
Applying this command results in output files with wildly varying sizes, e.g. 30-250 KB. I want to have output files with a maximum size adjusted to the web server's rigid limit (150KB) by adapting quality values. Doing this by hand is tedious. Can I do this automatically?

Re: Maximum size jpeg

Posted: 2014-11-03T08:19:34-07:00
by snibgo
I suppose the output format is jpeg.

Code: Select all

convert -distort resize 800x -strip -define jpeg:extent=150KB out.jpg
[Mod note: split from irrelevant thread.]

Re: Maximum size jpeg

Posted: 2014-11-03T09:15:48-07:00
by karlmistelberger
Applied the command to 85 images in folder. There was some wait, but the result is exactly what I hoped for. Sizes are now 100-149 KB and all pictures look fine. Thanks for relocating the post. :D