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.1.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.1-cp39-abi3-win_amd64.whl (294.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

arthash-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (383.9 kB view details)

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

arthash-0.1.1-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.1-cp39-abi3-macosx_11_0_arm64.whl (332.4 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

arthash-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl (363.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: arthash-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 41a1e460b1aec33f26484159f36387657190ad9b74cb637a4825d3173587f98c
MD5 d49771d16f80b2f4febc7c71c4472ffd
BLAKE2b-256 eca3cf89d4838c172d93ae8a9a5894eeb3b47c713951c7d875e285c495167a73

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: arthash-0.1.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 294.4 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.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 29b08ee60f6262d253c50650383e096a1b3201ac1603285ff800262d4512e754
MD5 819e8a4d1dbfdb058afebf922ca2fa4f
BLAKE2b-256 ea51cf54e0936496cca24826dc195efe4aa346903469ccac7211565fbde9493c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for arthash-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 65faca0d4d2082b0c80fb5a8a2fe85d890dd34ed4ee55d8845ba731afcab904d
MD5 ed862240018ab828f9c8ba412cf83728
BLAKE2b-256 d5ed878d99918589d1d6f07acfa4bc9b39f3824e8eafafc8a9f282db31b7a1ad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for arthash-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 096168db60efdcc0190b8ae29bd6af6ca0ac33f1169ecb5f6e88938769fc05e0
MD5 38fec6d8630f8a8a45bf2179e3c43287
BLAKE2b-256 f4aaf1b41b7fb931222e18433918fb45e92ed7da9b60c2e2f3865cb72b1a7cef

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for arthash-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4f8972397a0ad616b919646e5a7a4bc028bbd181535d6f80ee9bff455aa17069
MD5 3b145e4bfad6a25d38c31abb0040e4d1
BLAKE2b-256 808337e15f2c1872ce0a0556159de2b72f94e51bdd0536958503b337b62986c0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for arthash-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9a0a6b1eba8741d72b5fba753c1e8c53ded383ad72f5ea8e6b4f0230e6ec5822
MD5 2c7e6f99d5668e7b43f3fef6ede75b53
BLAKE2b-256 3bb0a9953ae96f20a3333ccba8a1a48b9ff9a65e2f5ce60eacfdaa7e95b9ec83

See more details on using hashes here.

Provenance

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