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, Preset
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.DETAIL_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, 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.

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.2.0.tar.gz (98.8 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.2.0-cp39-abi3-win_amd64.whl (301.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

arthash-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (395.3 kB view details)

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

arthash-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (361.6 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

arthash-0.2.0-cp39-abi3-macosx_11_0_arm64.whl (341.4 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

arthash-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl (373.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for arthash-0.2.0.tar.gz
Algorithm Hash digest
SHA256 26c3a3c5186d3d53d6cc765205348e20c9088ca95f18adeb9059bed8e2c30dc1
MD5 978f63db48b03066801a830a9bb91e58
BLAKE2b-256 c653d616ce5d3f0ca3b72e3c27b2d407bfd56736f73c6608b7f07563457ef152

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: arthash-0.2.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 301.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.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 aacc9469a23ddba799239f92aa41ed62fafab66b06970e9286816e8c631b2e3e
MD5 71d92697f8c7f21b464bb9702e6ed883
BLAKE2b-256 ba70d546a6aeddc46248c28daf4d1765a602dd12fc9b50729b70b33c961c39e5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for arthash-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa7c4d0ec25a3758dba4e1ac51d77330e3fe92bc1a847771090ad531b9fcac29
MD5 b0dc2d0886af75d0c970ecfe989dbe93
BLAKE2b-256 747550a6141a3eca373ee45045c4b5c60b68db4923719c6e7d719315aa5b155d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for arthash-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 30ef645d68ec27d6cf39eeddc884b4ca075ab5907318c282941f669a06d1dbc0
MD5 3a985f81fd3f552b1bd4e7d05e3364a2
BLAKE2b-256 ffedf27a8a884be273c8e1b833ebba56b58b90101f466abbeded151dbe8546a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for arthash-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 47f495fcae1687749f712419214fb4f63843591da98dbadb047abe2e9a5f3d64
MD5 b78cfdcb0cc5fcb2791732c85aae44df
BLAKE2b-256 74587977e7b6ec11e3699d6a127c0b9f188e466eaf0e1ba127a60668e3e81296

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for arthash-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6c113456d54f452ce33924c4576d96331e2b0b35ee0f38522fd683646c77eec0
MD5 b99d185c2b71b9183667690e3cab4d33
BLAKE2b-256 1b0b107d3e8631a326ac471fb2cb28f5b381daf484d5a521bb92fdd92a574a7a

See more details on using hashes here.

Provenance

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