ChromaHash: modern LQIP (Low Quality Image Placeholder) format
Project description
chromahash (Python)
Modern, high-quality image placeholder representation for professional formats (LQIP)
chromahash encodes an image into a compact, fixed 32-byte Low Quality Image
Placeholder (LQIP) and decodes it back into a low-fidelity preview. Color is
encoded in the perceptually-uniform OKLAB
space with wide-gamut input support (sRGB, Display P3, Adobe RGB, BT.2020,
ProPhoto RGB) and decodes to a caller-chosen display gamut (sRGB, Display P3,
or Adobe RGB).
This is the Python binding — a thin facade over UniFFI-generated ctypes
bindings to the Rust core. It carries no native algorithm of its own and produces
output bit-identical to every other ChromaHash implementation, validated
against the shared spec/ test vectors. It has zero external runtime
dependencies (ctypes is part of the standard library).
pip install chromahash
Usage
from chromahash import ChromaHash, Gamut
# width × height × 4 bytes (RGBA) — a 2×2 image here.
rgba = bytes([
255, 0, 0, 255, 0, 255, 0, 255,
0, 0, 255, 255, 255, 255, 0, 255,
])
ch = ChromaHash.encode(2, 2, rgba, Gamut.SRGB)
print(ch.as_bytes().hex()) # 32 bytes
# Reconstruct a preview. decode() targets sRGB; pass Gamut.DISPLAY_P3 or
# Gamut.ADOBE_RGB to render wide-gamut color.
width, height, pixels = ChromaHash.from_bytes(ch.as_bytes()).decode()
print(width, height, len(pixels))
Building from source
The native library and the generated bindings module are build outputs, staged
by the just recipe (needs the Rust toolchain):
just python-cbuild # stages chromahash/_uniffi.py + the native lib
just build-python and just test-python run this step automatically.
See the project repository for the full format specification and the other language implementations.
Note: ChromaHash is a pre-1.0 Draft format — the bitstream is not yet guaranteed stable across versions.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chromahash-0.6.0-py3-none-win_amd64.whl.
File metadata
- Download URL: chromahash-0.6.0-py3-none-win_amd64.whl
- Upload date:
- Size: 196.5 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf1745c6c8718ae5b18e80912b729973f46afd96d143c4391d230055a1a41c2b
|
|
| MD5 |
023986acf1d95afa4c762d27497df5d6
|
|
| BLAKE2b-256 |
21d722184001e32ccf2b42b1fcb126441369fa63148c2fe3c79e21a7989e97a3
|
Provenance
The following attestation bundles were made for chromahash-0.6.0-py3-none-win_amd64.whl:
Publisher:
release-pypi.yml on justin13888/chromahash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chromahash-0.6.0-py3-none-win_amd64.whl -
Subject digest:
bf1745c6c8718ae5b18e80912b729973f46afd96d143c4391d230055a1a41c2b - Sigstore transparency entry: 2026640044
- Sigstore integration time:
-
Permalink:
justin13888/chromahash@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/justin13888
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chromahash-0.6.0-py3-none-manylinux2014_x86_64.whl.
File metadata
- Download URL: chromahash-0.6.0-py3-none-manylinux2014_x86_64.whl
- Upload date:
- Size: 311.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e4b6b0c4f036a3bb46ebf2fffea4f6d2bd31aceb6e4be4b832367e3d5940031
|
|
| MD5 |
07c0da43c48d3e89f38272e124e4dce6
|
|
| BLAKE2b-256 |
3fbabf1a40f17bb33152c08b11dbbc77d775c6016984ea7554d7165d135ce0db
|
Provenance
The following attestation bundles were made for chromahash-0.6.0-py3-none-manylinux2014_x86_64.whl:
Publisher:
release-pypi.yml on justin13888/chromahash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chromahash-0.6.0-py3-none-manylinux2014_x86_64.whl -
Subject digest:
6e4b6b0c4f036a3bb46ebf2fffea4f6d2bd31aceb6e4be4b832367e3d5940031 - Sigstore transparency entry: 2026639920
- Sigstore integration time:
-
Permalink:
justin13888/chromahash@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/justin13888
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chromahash-0.6.0-py3-none-manylinux2014_aarch64.whl.
File metadata
- Download URL: chromahash-0.6.0-py3-none-manylinux2014_aarch64.whl
- Upload date:
- Size: 298.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18d38013c0dc4346c3b5964c1e3b887ca35177d10759567f8ceceaccfb60b528
|
|
| MD5 |
ba4ae76f682b15901fbfa234f7070cb4
|
|
| BLAKE2b-256 |
6bff54004cc551bde4649ca9bc6d25b8803266659a1ac75c345709c6d9de04e8
|
Provenance
The following attestation bundles were made for chromahash-0.6.0-py3-none-manylinux2014_aarch64.whl:
Publisher:
release-pypi.yml on justin13888/chromahash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chromahash-0.6.0-py3-none-manylinux2014_aarch64.whl -
Subject digest:
18d38013c0dc4346c3b5964c1e3b887ca35177d10759567f8ceceaccfb60b528 - Sigstore transparency entry: 2026639709
- Sigstore integration time:
-
Permalink:
justin13888/chromahash@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/justin13888
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chromahash-0.6.0-py3-none-macosx_11_0_x86_64.whl.
File metadata
- Download URL: chromahash-0.6.0-py3-none-macosx_11_0_x86_64.whl
- Upload date:
- Size: 303.2 kB
- Tags: Python 3, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f27567f43105afb1da8ab51038ee73e723ffefa892f1f81f1560cc5ee18c420b
|
|
| MD5 |
49e4bdf4326a532967eb87714dbb764f
|
|
| BLAKE2b-256 |
6a692e77b98e4890b4a855494510efed87798c41deff24056fe23206648707c8
|
Provenance
The following attestation bundles were made for chromahash-0.6.0-py3-none-macosx_11_0_x86_64.whl:
Publisher:
release-pypi.yml on justin13888/chromahash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chromahash-0.6.0-py3-none-macosx_11_0_x86_64.whl -
Subject digest:
f27567f43105afb1da8ab51038ee73e723ffefa892f1f81f1560cc5ee18c420b - Sigstore transparency entry: 2026639814
- Sigstore integration time:
-
Permalink:
justin13888/chromahash@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/justin13888
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chromahash-0.6.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: chromahash-0.6.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 291.7 kB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1287ef1e44002233df43961e4c5a021a1054ce28518256e157e52803b1f7dbb9
|
|
| MD5 |
a64c0c340c4256f5ff50ea2610136871
|
|
| BLAKE2b-256 |
53116bd3e2aaf2cc0e4543be300ccb998975d0e5e92c9911eb0ac9c92d466c93
|
Provenance
The following attestation bundles were made for chromahash-0.6.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
release-pypi.yml on justin13888/chromahash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chromahash-0.6.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
1287ef1e44002233df43961e4c5a021a1054ce28518256e157e52803b1f7dbb9 - Sigstore transparency entry: 2026640139
- Sigstore integration time:
-
Permalink:
justin13888/chromahash@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/justin13888
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@cf7699356f8a1d6affcf632dbf74d06e238bf1b5 -
Trigger Event:
workflow_dispatch
-
Statement type: