Today, there is a simple demand for a batch of PNG image files. the image name is xxx@2x.png, where xxx is a variable part. Now, rename all xxx@2x.png images to xxx.png and change the size to 50%. This involves two problems: Batch renaming and batch renaming...
Today, there is a simple demand for a batch of PNG image files. the image name is xxx@2x.png, where xxx is a variable part. Now, rename all xxx@2x.png images to xxx.png and change the size to 50%. This involves two problems: Batch renaming and batch file processing.
The solution is as follows:
1) batch renaming: for var in *. png; do mv "$ var" "${var@@2x.png#.png"; done
2) modify images in batches: for png in *. png; do convert $ png-resize 50% $ png
A convert command is used in batch Image Modification. This command is a sub-command of the command line Image processing tool ImageMagick. I have mentioned ImageMagick in my previous articles. For more information about children's shoes, see.
Author: Peacock