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.0.tar.gz (24.3 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.0-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file img2pixelart-0.1.0.tar.gz.

File metadata

  • Download URL: img2pixelart-0.1.0.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for img2pixelart-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fd2d53c8d60cceae5c3c4c3bfffafabf03d0c214bd816a2406074c2df3550280
MD5 6610b90681ffdb0e1dcc4fca3db7e774
BLAKE2b-256 80e75e780b86330d317bffb42dbd1b8aaa18a0464c611823437352735603189a

See more details on using hashes here.

File details

Details for the file img2pixelart-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: img2pixelart-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for img2pixelart-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39ea197535702888d6ecc5f00442e5ce4a8b18101b83dacae057b646eee45486
MD5 99b05a62cf43e20bf7ce906c78d9854d
BLAKE2b-256 13a3b4e763cd6e8f0f66706e032fced221db9d583244e22b421b7c9cc06b19a7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.1

2 files

This release

0.1.0 This release

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