Skip to main content

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 the arthash Rust crate. Compiled into arthash._native.
  • tests/ — pytest suite covering codec validation, V4 round-trip, shape round-trip, SVG generation, search-options, and the cross-language test vectors at docs/test-vectors/vectors.json.

Metadata

Release files for arthash 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arthash 0.6.2
File Size Uploaded
arthash-0.6.2.tar.gz 139.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for arthash 0.6.2
File
arthash-0.6.2-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
arthash-0.6.2-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.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
arthash-0.6.2-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
arthash-0.6.2-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.2.tar.gz

Download URL arthash-0.6.2.tar.gz
Size 139.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b031056e60d8771bf7ce53b2a77173e403483dd582760c0532cf59db2008618b
BLAKE2b-256 checksum
How to use checksums
c946cb48415b1857e66d75aac994c3d0fc0539324aa86792dd165e339641df37
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 30, 2026.

Transparency log

Release files / arthash-0.6.2-cp39-abi3-win_amd64.whl

Download URL arthash-0.6.2-cp39-abi3-win_amd64.whl
Size 326.2 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
413207e499a440e814a5c4f0a3380e5a9dacc617b7aab8b85026a759b8a78927
BLAKE2b-256 checksum
How to use checksums
eb09a2e6e62fd1b218dcedd7cf3de2b17a066816852c38733e027e598dd0fda7
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 30, 2026.

Transparency log

Release files / arthash-0.6.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL arthash-0.6.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 416.9 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
642d6cda00182d28d22c30d3d32c6924241be5685b98254ea89aa5b59ef5c0dc
BLAKE2b-256 checksum
How to use checksums
581eddafd7f62206d989e60e9361b0624c26e8a6b20b7e0ad431a844f79ad86d
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 30, 2026.

Transparency log

Release files / arthash-0.6.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL arthash-0.6.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 377.8 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
1c9fe7d202ac9da9bc8b9017917a43288715a182ef900046ab57859f20809822
BLAKE2b-256 checksum
How to use checksums
620a84492ce6673ddd912352e6e403f60f011a52d129567af6ac54b746c5919c
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 30, 2026.

Transparency log

Release files / arthash-0.6.2-cp39-abi3-macosx_11_0_arm64.whl

Download URL arthash-0.6.2-cp39-abi3-macosx_11_0_arm64.whl
Size 359.5 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
595ab18ede5dff44b58f871fea6f3f0283878874bc30883e07942daee4c3a2aa
BLAKE2b-256 checksum
How to use checksums
84060677fd63ab7d463d79530ca1f2c800e167c99dc4d32f01652f95a113663e
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 30, 2026.

Transparency log

Release files / arthash-0.6.2-cp39-abi3-macosx_10_12_x86_64.whl

Download URL arthash-0.6.2-cp39-abi3-macosx_10_12_x86_64.whl
Size 392.8 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7292158cbcdeac60adcea89203d0e8fa7fe7795f0dd88c5c4309f936b3a33732
BLAKE2b-256 checksum
How to use checksums
5b27db86ef824a4568f09cac5996ca12bd5aa7e7d1bd544625c7e0d342befea5
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 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.2 This release

6 release files

0.6.1

6 release files

0.6.0

6 release files

0.5.0

6 release files

0.4.0

6 release files

0.3.1

6 release files

0.3.0

6 release files

0.2.0

6 release files

0.1.2

6 release files

0.1.1

6 release files

0.1.0

6 release 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