6 个版本
使用旧的 Rust 2015
| 0.1.5 | 2017年6月12日 | 
|---|---|
| 0.1.4 | 2017年5月30日 | 
#715 在 图像
每月 26 次下载
2MB
161 行
自动图像裁剪器
- 
移除图像中的额外白色边界以正确调整画布大小。 
- 
感谢 @matthewkmayer 降低了裁剪时间! 
屏幕截图
这些边框只是为了表示实际测试的图像。(点击放大)
 
 
 
 
安装和使用
cargo install auto-image-cropper
或者如果你想走在科技的前沿
git clone https://github.com/Ritiek/auto-image-cropper
cd auto-image-cropper
cargo install
使用 autocrop 开始使用此工具。
USAGE:
    autocrop [OPTIONS] --input <LOCATION>
FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
OPTIONS:
    -i, --input <LOCATION>     Location of input image/directory
    -o, --output <LOCATION>    Location of output image/directory
基准测试
- 
这个工具被重新用 Python 编写,只是为了好玩,以与 Rust 进行比较。 
- 
基准测试在运行 macOS Sierra 10.12.2 的 MacBook Air 上进行。 
| 图像 | Python | Rust | 速度更快 | 
|---|---|---|---|
| face.jpg | 0.867s | 0.155s | 5.59 | 
| square.png | 1.682s | 0.142s | 11.84 | 
| flowers.jpg | 2.222s | 0.476s | 4.66 | 
| human.jpg | 2.362s | 0.294s | 8.02 | 
| pets.jpg | 5.366s | 1.704s | 3.14 | 
| agent47.jpg | 51.559s | 7.519s | 6.85 | 
- Python难以找到最佳坐标,但在保存裁剪图像回磁盘时速度很快(比Rust快)。Rust在找到最佳坐标方面表现真的很好。
贡献
- 
发现了一个错误/有一个想法?请随时在 问题部分 提交你的票据。 
- 
更好的是,发送一个 pull request。 :) 
许可证
TheMIT许可证
依赖关系
~3.5MB
~61K SLoC