Skip to main content

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

img2pixelart-0.1.1.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

img2pixelart-0.1.1-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

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

Hashes for img2pixelart-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d20dc78e933512a99269c1f16c59733afa46f83627ad955501c144ec0009b2d1
MD5 8f0bec736d25e478f5fee9561e7c5ac6
BLAKE2b-256 86420efea5c83d48c1902886aabe4f61f9caa3ff59fd6525f040152adbc2084b

See more details on using hashes here.

Provenance

The following attestation bundles were made for img2pixelart-0.1.1.tar.gz:

Publisher: publish.yml on asinkLuno/img2pixelart

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for img2pixelart-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 141547d9a4ef5a8dc27ea6b2c35879cab4dd577b52bfc79c1ae06143f896b81d
MD5 13ffe817df173b32bd2651b895baf5a1
BLAKE2b-256 ffb32e2e4923cf3f724fc03ef333eea7ed2ccd6a30dacdf0eb58cf3959f785a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for img2pixelart-0.1.1-py3-none-any.whl:

Publisher: publish.yml on asinkLuno/img2pixelart

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page