我的图像处理需要的命令行工具。
imgwrench的Python项目详细描述
图像扳手
我的图像处理需要的命令行工具多个子命令可以 按顺序执行以形成处理管道。
- 自由软件:麻省理工学院许可证
- 文档:https://imgwrench.readthedocs.io。
使用量
Usage: imgwrench [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
The main command line interface function of imgwrench
Options:
-i, --image-list FILENAME File containing paths to images for processing,
defaults to stdin
-p, --prefix TEXT prefix for all output filenames before numbering
[default: img_]
-d, --digits INTEGER number of digits for file numbering [default: 4]
-c, --increment INTEGER increment for file numbering [default: 1]
-k, --keep-names keep original file names instead of numbering
[default: False]
-f, --force-overwrite force overwriting output image file if it exists
[default: False]
-o, --outdir DIRECTORY output directory [default: .]
-q, --quality INTEGER quality of the output images, integer 0 - 100
[default: 88]
-e, --preserve-exif preserve image exif headers if available
[default: False]
--help Show this message and exit.
Commands:
blackwhite Convert color images to black and white.
colorfix Fix colors by stretching channel histograms to full range.
crop Crop images to the given aspect ratio.
frame Put a monocolor frame around images.
framecrop Crop and frame an image to a target aspect ratio.
resize Resize images to a maximum side length preserving aspect...
save No-op to enable saving of images without any processing.
stack Stack images vertically, empty space in the middle.
功能
- 子命令可以按顺序执行以形成管道
- 命令black white将图像转换为黑白 < L>命令> {EM1}$CalpFixeEEM >固定老照片颜色
- 命令crop用于裁剪图像以提供纵横比
- 命令dither用于将图像转换为黑白和抖动
- 命令filmstrip水平堆叠图像形成filmstrip
- 命令frame在图像周围放置单色边框
- 命令frame crop顶部帧并将图像裁剪为目标纵横比
- 用于调整图像大小的命令resize
- 命令save不进行处理,而是使用给定参数保存图像
- 命令stack用于垂直堆叠图像
管道
imgwrench子命令可以合并到管道中这样可以避免生成中间层 文件会使文件系统变得凌乱,并降低最终结果的质量。例如,如果你 要将当前目录中的所有图像转换为黑白,请放置一个白色框架 在它们周围,将它们切割成3:2的宽高比(用于标准格式打印),您可以 执行以下命令:
ls *.JPG | \
imgwrench -o out -q 95 -p oldschool_img_ \
blackwhite \
framecrop -a 3:2 -w 0.03 -c white
请参考detailed subcommand documentation中的各个参数
学分
这个包是用Cookiecutter和audreyr/cookiecutter-pypackage项目模板创建的
历史
0.8.0(2019-07-10)
- 抖动子命令
- filmstrip子命令水平堆叠图像
- 可以使用–PNG CLI标志以PNG格式保存图像
0.7.1(2019-05-16)
- 修复开发状态
0.7.0(2019-05-16)
- 保存ExIF图像元数据 的选项
- 使用-k/–保留名称运行时修复错误
- 状态进展到Alpha
0.6.0(2019-03-14)
- frame crop子命令将图像裁剪并框显为目标纵横比,包括测试和文档
- 中断更改:将命令模块移动到命令包
- 引入imageinfo作为管道中附加元信息的容器
- 增加测试覆盖率
- 更多文档
0.5.2(2019-03-10)
- 对颜色使用自定义参数类型
0.5.1(2019-03-09)
- 将默认帧宽度更改为0.025
- frame子命令的用法文档
- 子命令的一致字母排序
- 对比率使用自定义参数类型
0.5.0(2019-03-07)
- black white子命令,用于将彩色图像转换为黑白图像;包括doc
- frame子命令在图像周围放置单色边框;包括测试
0.4.0(2019-02-26)
- 将RGBA模式的PNG图像转换为RGB(以启用另存为JPG)
- 裁剪子命令将图像裁剪为指定的纵横比
- colorfix和crop文档
0.3.0(2019-02-17)
- -d/–digits选项指定文件名中的位数
- -c/–用于定义文件编号增量的增量选项
- 创建不存在的输出文件夹,而不是申诉< /LI>
0.2.0(2019年-01-30)
- 无操作保存命令,仅用于保存图像
- 如果输出图像已经存在 则引发异常
- -f/–强制覆盖标志以启用覆盖输出
- cli、pipeline和resize测试
0.1.1(2019-01-29)
- 修复主模块
0.1.0(2019-01-29)
- pypi上的第一个版本。