arthash
Placeholder-image hash family. Seven modes share a unified Codec API:
| Shape | Bytes (typical) | Notes |
|---|---|---|
| DCT | ~21 B | ThumbHash V4 derivative. Default. |
| CIRCLE | varies | SQIP-style overlapping circles. |
| TRIANGLE | varies | fogleman/primitive-style triangle mosaic. |
| SQUARE | varies | Axis-aligned squares (cx, cy, side). |
| RECT | varies | Axis-aligned rectangles (cx, cy, w, h). |
| ROTATED_RECT | varies | Rotated rectangles — theta_bits tunes angle steps. |
| PIXEL | varies | Retro-palette pixel mosaic. |
The implementation is a thin Python wrapper around the arthash-rs Rust crate
exposed via PyO3 — encode/decode/SVG all run in native code.
Install (from source)
maturin develop --uv -m packages/arthash-py/Cargo.toml
Quick start
from arthash import encode, decode, to_svg, Codec, Preset, RenderStyle
from arthash.palettes import PICO8
# DCT (default)
h = encode("photo.jpg")
w, hh, rgba = decode(h, base_size=256) # (h, w, 4) RGBA ndarray
# Named preset
codec = Codec.preset(Preset.LARGE_TRIANGLE) # triangle, n=64
h = encode("photo.jpg", codec)
# Factory + palette
codec = Codec.triangle(n=24, palette=PICO8)
h = encode("photo.jpg", codec, seed=0)
svg = to_svg(h, codec, base_size=256,
style=RenderStyle(blur=8.0)) # circle/triangle/etc.
decode always returns (width, height, ndarray(h, w, 4)) regardless of
codec — alpha is 255 except for DCT-with-alpha sources.
Visual styling — RenderStyle
decode and to_svg accept a style=RenderStyle(blur=…, corner_radius=…)
for visual softening. Both fields are applied identically across paths so
raster and SVG outputs stay visually consistent. corner_radius is only
honored for rect / square / rotated_rect codecs; other shapes silently
ignore it. to_svg(..., blur=...) still works but is deprecated since
0.3.0 — pass style=RenderStyle(blur=...) instead.
Layout
python/arthash/— public Python API (Codec,ShapeType,SearchOptions,palettes,encode,decode,to_svg).src/lib.rs— PyO3 binding to thearthashRust crate. Compiled intoarthash._native.tests/— pytest suite covering codec validation, V4 round-trip, shape round-trip, SVG generation, search-options, and the cross-language test vectors atdocs/test-vectors/vectors.json.
Metadata
Release files for arthash 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arthash-0.6.0.tar.gz | 137.1 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| arthash-0.6.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| arthash-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| arthash-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| arthash-0.6.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| arthash-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 2.0 MB
Release files / arthash-0.6.0.tar.gz
| Download URL | arthash-0.6.0.tar.gz |
|---|---|
| Size | 137.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afdce802429af9f09fe3236aae04593f67e7654cf95e8355a00fdc990286fdf1
|
|
BLAKE2b-256 checksum How to use checksums |
fbdf1ba77a9b73234ac3fc79de41de4bc245e6330540a5b279c119b670850482
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logRelease files / arthash-0.6.0-cp39-abi3-win_amd64.whl
| Download URL | arthash-0.6.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 328.0 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5e8555c86bd04963ac2789285c791a813289c48cada8c28c3811c41dd703b8c1
|
|
BLAKE2b-256 checksum How to use checksums |
28eea24bf9dbd71369c950061c867e3392377c739fffe7625ae7b4868b156143
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logRelease files / arthash-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | arthash-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 419.3 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c858743efa8ff0cbc7890ce25f8c2178fde1a6a3cf9f6575099e7292feb73b3a
|
|
BLAKE2b-256 checksum How to use checksums |
cc4d03a4e000774921f5b7f4a334774b70f36613ecf54d4137b7b4f9ac6005e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logRelease files / arthash-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | arthash-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 381.2 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
405ef6adae5edba76c4ccc427854dfccd4bc668ad47a1aa7eb31d502086782f2
|
|
BLAKE2b-256 checksum How to use checksums |
ad90a1f4ac8da0d26554b29a4542445d0f1a76c78ba2c49a287819cea0ed554e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logRelease files / arthash-0.6.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | arthash-0.6.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 362.5 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4a8d77ae66692d5f180284022e21bbbaa10d94d7ed7549a83b53c34894ee1899
|
|
BLAKE2b-256 checksum How to use checksums |
a8c818389e7d925763c4acf101bc754039b3821d23665be81ee5fc860f8b9d81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logRelease files / arthash-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | arthash-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 395.2 kB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
6d7e04416d5a25b15a86f64ef3bfa91f030eb9ac6b8f222751f7475b70d8cfeb
|
|
BLAKE2b-256 checksum How to use checksums |
79d0aa884b5097fffbb2002b8e47518fe8e08828dc4c78e071929623fef8b18a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency log