张春成
V2
2022/07/18阅读:15主题:默认主题
图像缩放工具
图像缩放工具
本例提供了一个批量图像缩放工具,用于指定目录下的图像统一缩放。 源码可见GITHUB[1]
Install & Operation
Resize images with command-lines.
$ python resize.py -h
usage: resize.py [-h] [-f FILTER] [-d DIR] [-c] [-m METHOD] [-w WIDTH] [-v]
optional arguments:
-h, --help show this help message and exit
-f FILTER, --filter FILTER
Filter file name
-d DIR, --dir DIR Directory to find images
-c, --compare Whether to compare interpolation methods
-m METHOD, --method METHOD
Use what method to interpolate, options are ['linear', 'area', 'cubic', 'lanc'], only
available when compare is unset
-w WIDTH, --width WIDTH
Width of the resized image
-v, --verbose Verbose
The terminal UI is

Outputs
It resizes the image with different interpolation methods. It turns out that the methods affect the quality more to the image with characters.
-
Image-1
-
Image-2
参考资料
GITHUB: https://github.com/listenzcc/resizeImages
作者介绍
张春成
V2