img2pixelart
图片转像素画 CLI。
安装
uv sync
uv pip install hydra-joblib-launcher # 多线程 multirun 需要
用法
单张转换
uv run img2pixelart img=tests/apple.jpg size=96
输出在当前目录的 result.png。
裁边
去掉图片四周空白区域:
uv run img2pixelart crop-padding tests/apple.jpg
# → tests/apple_no_padding.jpg
参数扫网(multirun)
多个参数值用逗号分隔,-m 开启 multirun,结果自动拼成 combined.png:
# 渐变层次 × 抖动风格 × 描边,81 种组合
uv run img2pixelart -m \
img=tests/apple.jpg \
perceive.ramp_steps=5,7,9 \
render.silhouette_dark_step=0,1,2 \
render.internal_outline_dark_steps=0,1,2 \
render.pattern_style=ordered,diagonal,clustered \
size=96
并行扫网
加 Joblib launcher,n_jobs=-1 用满所有 CPU:
uv run img2pixelart -m \
img=tests/apple.jpg \
perceive.ramp_steps=5,7,9 \
render.silhouette_dark_step=0,1,2 \
render.internal_outline_dark_steps=0,1,2 \
render.pattern_style=ordered,diagonal,clustered \
size=96 \
hydra/launcher=joblib \
hydra.launcher.n_jobs=-1
关键参数
| 参数 | 说明 | 默认值 |
|---|---|---|
size |
输出像素画尺寸 | 96 |
perceive.ramp_steps |
每色相的明度阶梯数 | 5 |
perceive.requested_groups |
色相族数量 | 2 |
render.pattern_style |
抖动风格:ordered / diagonal / clustered |
ordered |
render.silhouette_dark_step |
外轮廓暗化级数(0=无) | 0 |
render.internal_outline_dark_steps |
内部描边暗化级数(0=无) | 1 |
render.dither_fraction_min |
抖动区域下限 | 0.18 |
render.dither_fraction_max |
抖动区域上限 | 0.82 |
完整参数见 img2pixelart/conf/ 目录下各阶段 YAML 文件。
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file img2pixelart-0.1.1.tar.gz.
File metadata
- Download URL: img2pixelart-0.1.1.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d20dc78e933512a99269c1f16c59733afa46f83627ad955501c144ec0009b2d1
|
|
| MD5 |
8f0bec736d25e478f5fee9561e7c5ac6
|
|
| BLAKE2b-256 |
86420efea5c83d48c1902886aabe4f61f9caa3ff59fd6525f040152adbc2084b
|
Provenance
The following attestation bundles were made for img2pixelart-0.1.1.tar.gz:
Publisher:
publish.yml on asinkLuno/img2pixelart
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
img2pixelart-0.1.1.tar.gz -
Subject digest:
d20dc78e933512a99269c1f16c59733afa46f83627ad955501c144ec0009b2d1 - Sigstore transparency entry: 2367508382
- Sigstore integration time:
-
Permalink:
asinkLuno/img2pixelart@e3b702274a1fdf4b3ac31d534cfe49ebb46c1b75 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/asinkLuno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e3b702274a1fdf4b3ac31d534cfe49ebb46c1b75 -
Trigger Event:
push
-
Statement type:
File details
Details for the file img2pixelart-0.1.1-py3-none-any.whl.
File metadata
- Download URL: img2pixelart-0.1.1-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
141547d9a4ef5a8dc27ea6b2c35879cab4dd577b52bfc79c1ae06143f896b81d
|
|
| MD5 |
13ffe817df173b32bd2651b895baf5a1
|
|
| BLAKE2b-256 |
ffb32e2e4923cf3f724fc03ef333eea7ed2ccd6a30dacdf0eb58cf3959f785a0
|
Provenance
The following attestation bundles were made for img2pixelart-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on asinkLuno/img2pixelart
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
img2pixelart-0.1.1-py3-none-any.whl -
Subject digest:
141547d9a4ef5a8dc27ea6b2c35879cab4dd577b52bfc79c1ae06143f896b81d - Sigstore transparency entry: 2367509045
- Sigstore integration time:
-
Permalink:
asinkLuno/img2pixelart@e3b702274a1fdf4b3ac31d534cfe49ebb46c1b75 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/asinkLuno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e3b702274a1fdf4b3ac31d534cfe49ebb46c1b75 -
Trigger Event:
push
-
Statement type: