Resize image with limit in linux [closed]
开发者_如何转开发
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionI want to resize image in linux and want this image to be convert to below the threshold value (certain limit).
eg. Threshold Limit: 500Kb, Image dimension: 100x100
Output image will be in 100x100 dimension and size below 500Kb or exactly 500kb (Not more than 500Kb)
Appreciate your help.
One possible solution would be to use Imagemagick inside a shell script and do the following:
- Scale down your image to 100x100 pixels.
- Check if the files size is <= 500kb
- If yes: youre done.
- If not: user imagemagicks "convert" to convert your image to a lower quality and then go back to step 2.
精彩评论