Skip to main content

Placeholder-image hash family — DCT / CIRCLE / TRIANGLE / PIXEL modes share a unified Codec API. PyO3 binding to arthash-rs.

Project description

arthash

Placeholder-image hash family. Four 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.
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, ShapeType

# DCT (default)
h = encode("photo.jpg")
w, hh, rgba = decode(h, base_size=256)

# Shape modes
codec = Codec(shape=ShapeType.CIRCLE, n_shapes=12)
h = encode("photo.jpg", codec, seed=0)
w, hh, rgb = decode(h, codec, base_size=256)        # (h, w, 3) RGB ndarray
svg = to_svg(h, codec, base_size=256, blur=8.0)     # circle/triangle only

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arthash-0.1.0.tar.gz (81.7 kB view details)

Uploaded Source

Built Distributions

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

arthash-0.1.0-cp39-abi3-win_amd64.whl (293.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

arthash-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (383.4 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

arthash-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (352.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

arthash-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (331.6 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

arthash-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl (363.1 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: arthash-0.1.0.tar.gz
  • Upload date:
  • Size: 81.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arthash-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9069c969fed7f13e832cc34e7b299fb93be0013d4820327b0d8a8cc6e8c4c3bb
MD5 6f66f65233832afd17e55337688bf60f
BLAKE2b-256 46d6f8bf8552183cabaedb1bc9a7669b693ede4e0698915ce58311753fc69ad2

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.0.tar.gz:

Publisher: wheels.yml on Jannchie/arthash

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

File details

Details for the file arthash-0.1.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: arthash-0.1.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 293.8 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arthash-0.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f32ec0d83a857c5e781b4f68e81be8ec8382d4ae98810de2d2ee137a21992092
MD5 381944c3d415cd640e8e03f8cf0bda2b
BLAKE2b-256 d59ed5acca47c333b48ae7a7337a0d113e322528b35a899f79aa94b5f5086812

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.0-cp39-abi3-win_amd64.whl:

Publisher: wheels.yml on Jannchie/arthash

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

File details

Details for the file arthash-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for arthash-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73d2e354943e837830d40c71e96056f3211caa2740c3ee109f4beaa3881d6c16
MD5 918c291eb029be6dbaa0ae7589a5be88
BLAKE2b-256 c50fe11bf1704b049579de46c35bee8515401eaed6cc26ee38fa39c612f9b72e

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on Jannchie/arthash

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

File details

Details for the file arthash-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arthash-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 737e07143ee1815353d923020b109c7285d86bb18ff454c8a9ebc2727a33f00e
MD5 0f18bf3af6505902e864fad4f2152e7e
BLAKE2b-256 2dda1d0f94e7c8496586c484dcbb31d10aa07478ba78f053655cbd2891ef27df

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: wheels.yml on Jannchie/arthash

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

File details

Details for the file arthash-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arthash-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 413fc24d8cb4321181167c5a76f1aee68c7b43f64060a7facd03fe7de4da242d
MD5 e23beee108b5a3b0127a841a16d7240a
BLAKE2b-256 48fcd08acd5b7a4ea11b5b582875a413a674c0f22c7ebab352a06f905ead9015

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Jannchie/arthash

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

File details

Details for the file arthash-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for arthash-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a510deb8f4b848931c9a8fbb2606aa623a8a23e51f59a247a7038a7e863bfcf5
MD5 f9cdff00261e9fd8f86a3d6007b3fe6b
BLAKE2b-256 b1c14ec9481b9b9cd252928678f56170a49ef9b3dc9fe560f2d18520989f078e

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: wheels.yml on Jannchie/arthash

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page