In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how Ubuntu batch compressed pictures, I hope you have something to gain after reading this article, let's discuss it together!
The following is Ubuntu compression picture batch method, these Ubuntu compression picture method is what I have learned for a long time, I hope it will be helpful to you. Many of the photos taken with DC are very large, and sometimes we need to shrink them. Recently, I went around google and found some useful commands. I wrote a small script to refer to the powerful imagemagick tool I used.
If you don't have it, you can install it through Xinlide. The command you need for # sudo apt-get install imagemagick is convert. The script I wrote uses two parameters. Resize and fontresize are used to reduce the size of the picture. The usage is-resize image size.
For example:-resize 50% x 50%
This parameter is to reduce the length and width of the original image by 50%. I reduce the size of the picture to compress the size of the picture. Of course, you can also achieve the purpose of compression by changing the quality of the picture. As the name implies, the parameter to change the image quality is-quality.
The parameter-quality 70 indicates that the quality of the image should be reduced to 70% (basically you can't see the difference from the original image)
The parameter of adding font watermark is
-font font name-fill font color-pointsize font size-draw "text font start coordinates" text content "specific you can query man, explain in great detail, * look at the simple script I wrote.
# imagezoom.sh
For img in `ls * .JPG`; do convert-resize 50% x50% convert-fonthelvetica-fill white-pointsize 36-draw 'text 10J 50 "Pictures ByPDAsk.net"' $img Resized-$img; done this script implements the function of reducing all the images with the JPG suffix in the directory by 50%, and printing the watermark in the upper left corner with helvetica font. The processed image is named "Resized- original file name". Open gedit or leafpad, enter the content of the script, save it as imagezoom.sh, I saved it on the desktop, and then
# chmod + x ~ / Desktop/imagezoom.sh
For ease of calling, I copy the script to the / bin directory so that I can use this command in any image folder in the future.
# sudo cp ~ / Desktop/imagezoom.sh / bin
After reading this article, I believe you have a certain understanding of "Ubuntu how to compress pictures in batches". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.