Skip to main content

Fast ThumbHash bindings for Python using Rust (PyO3)

Project description

fast_thumbhash

A fast Python package for ThumbHash image encoding/decoding using Rust bindings (PyO3, maturin) to the official thumbhash crate.

fast_thumbhash is 60.5x faster than the pure Python implementations I tested:

28.13854099076707 ms (thumbhash)
0.46491601096931845 ms (fast-thumbhash - this package)

thumbhash-python was also taking the same time range as thumbhash (27 - 35 ms).

Features

  • Exposes rgba_to_thumb_hash, thumb_hash_to_rgba, thumb_hash_to_average_rgba, thumb_hash_to_approximate_aspect_ratio.
  • Supports raw RGBA bytes and Pillow Image (Pillow is optional).

Installation

pip install git+https://github.com/sitatec/fast_python_thumbhash.git

Build from source using maturin:

maturin develop

Usage Example

from fast_thumbhash import rgba_to_thumb_hash, thumb_hash_to_rgba
from PIL import Image

img = Image.open('example.png').convert('RGBA')
thash = rgba_to_thumb_hash(img)
restored = thumb_hash_to_rgba(thash)

License

MIT

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

fast_thumbhash-1.0.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distributions

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

fast_thumbhash-1.0.0-cp312-cp312-win_amd64.whl (114.0 kB view details)

Uploaded CPython 3.12Windows x86-64

fast_thumbhash-1.0.0-cp312-cp312-win32.whl (107.8 kB view details)

Uploaded CPython 3.12Windows x86

fast_thumbhash-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl (247.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fast_thumbhash-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (210.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fast_thumbhash-1.0.0-cp311-cp311-win_amd64.whl (113.5 kB view details)

Uploaded CPython 3.11Windows x86-64

fast_thumbhash-1.0.0-cp311-cp311-win32.whl (107.5 kB view details)

Uploaded CPython 3.11Windows x86

fast_thumbhash-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl (247.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fast_thumbhash-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (210.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

fast_thumbhash-1.0.0-cp310-cp310-win_amd64.whl (113.6 kB view details)

Uploaded CPython 3.10Windows x86-64

fast_thumbhash-1.0.0-cp310-cp310-win32.whl (107.5 kB view details)

Uploaded CPython 3.10Windows x86

fast_thumbhash-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl (247.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

fast_thumbhash-1.0.0-cp310-cp310-macosx_11_0_arm64.whl (210.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file fast_thumbhash-1.0.0.tar.gz.

File metadata

  • Download URL: fast_thumbhash-1.0.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fast_thumbhash-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3ac95c0f5b5020763af096c2812012a75b501d6ada8b5340acc7d96a1bb6b85a
MD5 c977338b0279ad73e7fb6957336fecb3
BLAKE2b-256 54288d65e1e95998f5e28a0a68af548ff04082942556a7961d73eded495427dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0.tar.gz:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for fast_thumbhash-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ceb3336a7a7d6f2a05063b80a47a0c3654d539492953a09762817059df93595e
MD5 285af62f4351c45963198c2f343e9e96
BLAKE2b-256 1ea5cb4ba71c455da378187650503fc2526c13f5d8065fceba0ed6ad75c09ce0

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: fast_thumbhash-1.0.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 107.8 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fast_thumbhash-1.0.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 ce0a0dd828c5f3b70c2c99edac93c4b9d24558eaa45c2a8332fe9cb075492e54
MD5 c4707623efb75ab107603e9ae286874c
BLAKE2b-256 50f20947968c4b6c0dea7a980a74552b66a8038051def02ebdae7cddb34731dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp312-cp312-win32.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fast_thumbhash-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d5bb7323846bc0ace579a8aa5b87c7ab5e32fd4774814d1156c1e119bff3d7bf
MD5 060b8ab9fc862518aa9303c94bf04927
BLAKE2b-256 d53fc1747d8ad6a71badf00e53fac3d4328fc9f048fc63cf2846639222eedff7

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_thumbhash-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53efd7935a5a026bcfab7f0ff7f2c7ad57ed42cdbbd0597a3d5365ea769f4b37
MD5 baeee5e6aa6f44f6210635e9353d002b
BLAKE2b-256 2b81eb982cda3e2a8ef71ad4e974155d53436ed9e23d6cc56d42a80998c19c92

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for fast_thumbhash-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 931d02851a4a629889a97a01ff34e4bd561d1d90df6aa2361ecbdd510217911e
MD5 f891295a8f60986395d9cc1d39d1b09b
BLAKE2b-256 2eae6636e625aa48ec67dc5b941f13902349290308c7b7594d5b3c8adf7a8a14

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: fast_thumbhash-1.0.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 107.5 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fast_thumbhash-1.0.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 7441092d80602ba9c875d895cdd2196daded75d14ff92b6594b565291f9a4d26
MD5 eb7225161d98a185e1997543fe049a25
BLAKE2b-256 320da0831dd9533f8fbf5d9d0348dad7dd3aa7044e0844baf75446768947e9b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp311-cp311-win32.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fast_thumbhash-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f168b1f672240b778e5b7a3ecacd03bf0ff4ba5f8f4692cec5f80f2709bf3020
MD5 2593d040efd3f7ab2b67d574a28f2bcd
BLAKE2b-256 34136b486ae7e4e53f04921ea4b6fb112ffe51833eed92e0615459f99e1c1f66

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_thumbhash-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f4a5828bb675ab4c64639ab3e3cf5006151b71dec6ff879e796a8c93738d7c4
MD5 e8f94eb73c5c6ba70a6e8015b2985bd3
BLAKE2b-256 9f3fa84f1358b8e421e24efae345deddc12ff7481c9a5708382b1fc639f65c5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for fast_thumbhash-1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dc6d0c1178ecfec34fa752b7dc143a1bb33196559ed5cf17f63aca32e2104f2f
MD5 3fd45d9cfdb1bb9f1602f5eac08d3502
BLAKE2b-256 a96efedb4a4e8498d6638b2e680529acdbb535a2efa8636df6c7a396a5efec0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp310-cp310-win_amd64.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: fast_thumbhash-1.0.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 107.5 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fast_thumbhash-1.0.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 c71f91d95957272832130c633fc2cb041d13d7639d26d980ab9f569588d55cd8
MD5 593124666055d3c95597cbde8ee9dc6b
BLAKE2b-256 a7bb5c6fe593970aed9155d4f2a7102daa4904655fe74763978eb20542713a2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp310-cp310-win32.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fast_thumbhash-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1acc03912cde8cef4611804b5bfe85e61ee8166569bec2987a52779765697cb9
MD5 4a30e21db911988604cdfba64954eaef
BLAKE2b-256 74ae7d1a4ecfada00eec456b173984ff918c6f47fc7eb86c1bab25c9597990bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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

File details

Details for the file fast_thumbhash-1.0.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_thumbhash-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7963cefed9ffcd7c672357fc179767412723022837e459c0c5d6d66da85f6258
MD5 ce70338b29a31e538eec14e2224c4939
BLAKE2b-256 3dc04641c5d41c835b5ec09a25328fe819c6e5f642b9ec8e76e4337f85e8f330

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_thumbhash-1.0.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on sitatec/fast_python_thumbhash

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