#convert-images #image #numbers #command #paint #pbn #dwango-ac

bin+lib pbnify

将图像转换为一系列 PBN (画数字画) 命令

3 个不稳定版本

0.2.1 2019 年 3 月 25 日
0.2.0 2019 年 3 月 25 日
0.1.0 2019 年 2 月 5 日

#819 in 图像

每月 42 次下载

GPL-3.0 许可证

22KB
381

PBNify

将图像转换为 dwangoAC 的画数字画命令,并附带一些内置的图像处理工具。

此crate具有用于人类和脚本的命令行界面(在此处文档化)和用于Rust程序的API([外部文档](https://docs.rs/pbnify))。

安装

crate的最新版本发布在crates.io上,如果您已安装Rust,则可以轻松运行

$ cargo install pbnify

如果您想测试/开发最新的master分支,可以使用Cargo构建它,然后使用以下命令运行而不是$ cargo run -- ...

$ git clone https://gitlab.com/agausmann/pbnify.git
$ cd pbnify
$ cargo build

基本用法

将图像的原始数据转换为PBN命令

$ pbnify -i my_image.png
#000000ff 1,1;1,2;2,1;
...

将图像的左上角移动到不同的位置

$ pbnify -i my_image.png -x 40 -y 30
...

在生成PBN之前缩放给定的图像

$ pbnify -i my_image.png -w 132 -H 99
...

量化图像(减少唯一颜色的数量;在这种情况下,为16)

$ pbnify -i my_image.png -n 16
...

完整用法

USAGE:
    pbnify [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -H, --height <HEIGHT>     Rescales the picture to HEIGHT pixels tall. Will preserve the original ratio unless
                              --width is also provided.
    -i, --input <FILE>        Tells the program to accept the image from FILE. If this option is not present, standard
                              input will be read and PNG is assumed.
    -l, --max-length <NUM>    Sets the maximum length of a command. [default: 400]
    -o, --output <FILE>       Tells the program to write the generated output to FILE. If this option is not present, it
                              will be written to standard output.
    -n, --quantize <SIZE>     Generates a palette of size SIZE, and quantizes the input image before PBNification.
    -w, --width <WIDTH>       Rescales the picture to WIDTH pixels wide. Will preserve the original ratio unless
                              --height is also provided.
    -x, --x-offset <NUM>      Offsets the output x coordinates by the given amount. [default: 0]
    -y, --y-offset <NUM>      Offsets the output y coordinates by the given amount. [default: 0]

许可证

版权 (C) 2019 Adam Gausmann

本程序是自由软件:您可以自由分发和/或修改它,只要按照自由软件基金会发布的GNU通用公共许可证的条款进行,许可证版本为3,或者(根据您的选择)任何更高版本。

本程序的分发是希望它将是有用的,但没有任何保证;甚至没有关于适销性或特定用途适用性的暗示保证。有关详细信息,请参阅GNU通用公共许可证。

您应该已收到一份GNU通用公共许可证副本。如果没有,请参阅https://gnu.ac.cn/licenses/

依赖关系

~13MB
~84K SLoC