Batch image reduction in Linux

Source: Internet
Author: User
The ImageMagick toolkit is used.
@ Ubuntu
Sudo apt-Get install ImageMagick

Reference
$ Convert-resize 50% x50 % 1.jpg unzip small.jpg
You can reduce the size of 1.jpg to 1/4.
Reference
$ Convert-sample 400x300 1.jpg unzip small.jpg
The size of 1.jpg can be reduced to 400x300.
Note that the two ratios/numbers are separated by the letter X, not the multiplication number.

Then let's make a batch conversion (the online tutorial is for, although I prefer find)
Reference
For IMG in 'ls *. jpg '; do convert-resize 50% x50 % $ IMG small _ $ IMG; done

If you want to recursively convert the image of the current directory and subdirectory, use find:
Reference
Find-name "*. jpg"-exec convert-resize 50% x50 % {} found 2.16.small.jpg

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.