Skip to main content

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

Project description

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, 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.2.tar.gz (344.5 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.2-cp39-abi3-win_amd64.whl (294.5 kB view details)

Uploaded CPython 3.9+Windows x86-64

arthash-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (384.3 kB view details)

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

arthash-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (353.1 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

arthash-0.1.2-cp39-abi3-macosx_11_0_arm64.whl (332.4 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

arthash-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl (363.7 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: arthash-0.1.2.tar.gz
  • Upload date:
  • Size: 344.5 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.2.tar.gz
Algorithm Hash digest
SHA256 3953a4fa65eafef813c9ca21bfe64742b056029177b4345a21b7693016885471
MD5 27e4d4de005a7b5476bdeb71be92c38b
BLAKE2b-256 b9f66cc3da2f41c0fd59a38be7c2d565abed70de858b5eff85707e7f63017cfc

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.2.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.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: arthash-0.1.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 294.5 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.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ce6642783155a6d3f6b029be8a9699a691c4dca72917b4f28766ea3f1d227f07
MD5 e13a891806a942d642bb39c3bf5b9793
BLAKE2b-256 383cf5a5a625de8e93c5a7f423d461d39d43d3343eab398c4df3189b4238f37b

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.2-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.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for arthash-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d362e47f5e995b2247e7d6900e7a55312b7ea7729341aa3467def1c523f238de
MD5 324c93d5d08fd46618ef1f7128c21930
BLAKE2b-256 db62d09f138ce6297033ff3bc970868256202e51c5f89a7ead285766c8080d97

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.2-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.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arthash-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 79d5dfebe7597a5bc65f5b7b9ca411f87df7599621e3622a80e97c4ef7001d57
MD5 5ef46f039cbed8f5935a368fa913805f
BLAKE2b-256 98193236693c0527697917b06a4c8a9745aa1970b3b62bec581605748bbe51c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.2-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.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arthash-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d6ec1dcb28fd9d0158b2a8a820281932f6fd99b2dff014f7d1dcd41679afa79
MD5 41ec1583f26d96bd36bc91dbc33d4b8f
BLAKE2b-256 55c16f0c30be887eb53f845ab1f6185e3cc91980467e7c0d01320c1404723475

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.2-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.2-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for arthash-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 145bf05d0c7b7ca6e3b090336e713167b327ed6024270432ba9fb546da49785e
MD5 eeb0b0d516ab646ffc5d8ae910646a19
BLAKE2b-256 16464b57fc7ea0ca5e6cdaa4095a62987fddaaefc3ea0e179c3bd50ead77beae

See more details on using hashes here.

Provenance

The following attestation bundles were made for arthash-0.1.2-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