2 个不稳定版本
| 0.2.0 | 2019 年 2 月 27 日 |
|---|---|
| 0.1.0 | 2019 年 2 月 6 日 |
#14 in #output-image
99KB
2K SLoC
Stew
Stew 是一套图像变换工具,源自于 sic。Sic 只有一个可执行文件,而 Stew 每个图像操作都有一个单独的可执行文件。这使得 Stew 工具集中的工具可以相互连接,并且可以与其他 cli 应用程序进行交换(假设 Stew 支持此类工具的输出格式作为输入)。
crates.io: Stew
安装
使用 cargo 安装: cargo install --force stew
预构建的二进制文件:请参阅 发布
从本仓库的源代码
- 使用(例如)rustup 设置 rust 和 cargo
需要 Rust 版本 >= 1.31 且使用 'Rust 版本 2018'。 - 克隆此仓库:
git clone https://github.com/foresterre/stew.git - 切换到此仓库:
cd stew - 构建发布版本:
cargo build --release
使用方法
以下示例用法假设输入图像为 input,图像名称为 botanical.jpg,输出图像为 out.png。
crop -i botanical.jpg -o out.png 10 10 210 210
cat botanical.jpg | crop 10 20 180 210 | blur 15 | fliph -o target/out.png
cat resources/botanical.jpg | ./target/debug/blur 80 | ./target/debug/brighten -o target/out.png -70
注意:当使用 stdout 进行图像输出时,不能使用扩展来确定图像输出格式。所有 Stew 工具默认输出格式为 BMP,但您可以使用 --output-format(缩写 -f)命令行选项指定不同的格式,如下所示
cat resources/botanical.jpg | ./target/debug/unsharpen -f png 40 10 > target/out.png
通过使用帮助标志运行各个工具来显示其用法:<tool> --help,例如 huerotate --help。
可用工具
-
blur[u32] -
brighten[i32] -
contrast[f32] -
convert -
crop[u32] [u32] [u32] [u32] -
filter3x3[f32] [f32] [f32] [f32] [f32] [f32] [f32] [f32] [f32] -
fliph -
flipv -
grayscale -
huerotate[i32] -
invert -
resize[u32] [u32] -
rotate90 -
rotate180 -
rotate270 -
unsharpen[f32] [i32]
建议、问题、错误
如果您有建议、问题或发现错误,请随时提交问题 📬 =)。
🎸 🎺 🎻 🎷
依赖项
~14MB
~87K SLoC