I need to resize image based on memory.
What I am getting is following option in "convert" command.
-resize 800x600
-resize 25%
Is there any command like -
-resize 10KB
Thanks
I need to resize image based on memory.
What I am getting is following option in "convert" command.
-resize 800x600
-resize 25%
Is there any command like -
-resize 10KB
Thanks
Use this:
convert input.jpg -define jpeg:extent=300kb ... output.jpg
If you want a way to do something similar with Python, I wrote an answer that works pretty well here. It does a binary search for a JPEG quality that satisfies a maximum size requirement.
convert vik.jpg -define jpeg:extent=10kb out.jpg
-rw-rw-r-- 1 user user 22920 Oct 3 00:17 vik.jpg
-rw-rw-r-- 1 user user 25144 Oct 29 19:40 out.jpg
– user811602 Oct 29 '14 at 14:12