hqx (high quality scale) is a family of pixel art scaling algorithms that work by detecting differences between pixels in the YUV colorspace.
hq2x scales an image by 2x, hq3x by 3x, and hq4x by 4x.
This is a Python port of hqx, unoptimized. It is not intended to be used for videos or scenarios where low latency is required. Right now, it only supports RGB, not RGBA (no transparency support).
Table of contents
📦 Installation
hqx is available on PyPi.
It requires a Python version of at least 3.10.0.
It depends on Pillow.
To install hqx with pip, run:
python -m pip install hqx
🛠 Usage
You can either use hqx.hqx_scale, hqx.hq2x, hqx.hq3x, or hqx.hq4x.
import hqx
import PIL.Image
image: PIL.Image.Image = PIL.Image.open(...)
x2: PIL.Image.Image = hqx.hq2x(image)
x3: PIL.Image.Image = hqx.hq3x(image)
x4: PIL.Image.Image = hqx.hq4x(image)
# x2 == hqx.hqx_scale(image, 2))
# x3 == hqx.hqx_scale(image, 3))
# x4 == hqx.hqx_scale(image, 4))
📰 Changelog
The changelog is at CHANGELOG.md.
📜 License
hqx (python) is licensed under the Lesser GNU Public License v2.1 (LGPL-2.1).
Metadata
Release files for hqx 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hqx-1.0.tar.gz | 24.5 kB | Without provenance | Details for hqx-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hqx-1.0-py3-none-any.whl | Python 3 | none | any | Details for hqx-1.0-py3-none-any.whl |
Total release size: 51.4 kB
Release files / hqx-1.0.tar.gz
| Download URL | hqx-1.0.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d680a53d2d3e279645581c1b4f45d4541c14a7a9082f79b976ae3c199d3cb08
|
|
BLAKE2b-256 checksum How to use checksums |
ee126e9bcd03c563c8feee5a75ca7da7008f6c6383385c84c03e8176df72bb69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / hqx-1.0-py3-none-any.whl
| Download URL | hqx-1.0-py3-none-any.whl |
|---|---|
| Size | 26.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0d84f405f6160cb844edaebabc23a9cea95970450a1686c26c75586c111631b
|
|
BLAKE2b-256 checksum How to use checksums |
5a746f3c29e4c7a9e40af96b9b0cb82dfafadb5b14ddca0e47b15269c8d9f1e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for hqx 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.