Limit Image Quality
.-. .-..---.
| |__ | || O ,
`----'`-'`-'\\
Limit the quality of images in your repo via pre-commit.
Disclaimer
This tool does not make backups of files it changes.
This tool uses ImageMagick's quality detection. This method is not flawless and based on internal metrics that may change. This is why the recommended way to use this tool is via a Docker image with a fixed tag. It's less likely the same image will get different results if the underlying ImageMagick version does not change.
Usage
It's recommend to use pre-commit directly via the pre-build docker image we release.
Parameters
Run liq --help to get an up-to-date list.
Defaults are not considered part of a stable and may change version to version.
Usage: liq [OPTIONS] PATHS...
.-. .-..---. Qteal
| |__ | || O , fixing systems, not people
`----'`-'`-'\\ v0.1
Limit the quality of JPG images.
When running with --fix it will overwrite the file(s) in question.
No backups are made. This is a potentially destructive operation!
Exits with 1 if any files where/would have been changed.
Options:
--version Show the version and exit.
-q, --quality INTEGER RANGE [default: 75; 0<=x<=100]
--fix / --no-fix [default: no-fix]
-v, --verbose log the detected quality of every image
--help Show this message and exit.
pre-commit
The intended use is via the provided hook in the repo, using the docker hook:
repos:
# This repo <3
- repo: https://gitlab.com/Qteal/oss/liq
rev: main
hooks:
- id: limit-image-quality-docker
args: [-q75, --fix]
Then run pre-commit autoupdate to transform the main rev into the latest release.
There is also a hook that does not use docker (limit-image-quality), for which you have to install ImageMagick yourself according to Wand's documentation.
This hook is usually quicker, but is more likely to result in version differences as it relies on system software.
Docker image
It's also possible to use the docker image directly.
The image is published to registry.gitlab.com/qteal/oss/liq/liq.
Every release gets a tag, latest is always up-to-date with the latest release.
You can also use branch name tags, so main is good for those living on the bleeding edge.
Pip
The Python package is also push to the package registry of this repo (for all builds on main) and pypi (for releases).
Install via pip as pip install liq.
Run liq --help for more info.
You must install the required system dependencies of Wand yourself.
Local Development
Only supported on Linux or something Linux like enough that I won't notice when you make a merge request.
If you want to work on this project, you need to have ImageMagic installed including the development libraries and headers. It's recommended to follow the installation instructions in Wand's documentation.
Use Hatch to set up the project environment.
Metadata
Release files for liq 0.1.2
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 |
|---|---|---|---|---|
| liq-0.1.2.tar.gz | 222.2 kB | Without provenance | Details for liq-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| liq-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for liq-0.1.2-py3-none-any.whl |
Total release size: 228.3 kB
Release files / liq-0.1.2.tar.gz
| Download URL | liq-0.1.2.tar.gz |
|---|---|
| Size | 222.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ffe10f444175fb2c08733c60fa8c7912a27e2b7ba25667c26bd6c75dc562f03
|
|
BLAKE2b-256 checksum How to use checksums |
aa93310755549686da24da5464714a7dd1be572f86de9912987df52849e58edd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Release files / liq-0.1.2-py3-none-any.whl
| Download URL | liq-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97d2d646b2e87b745c3db8f7a4e3df10a2892cfc9493e84c0d20c2c12d80177d
|
|
BLAKE2b-256 checksum How to use checksums |
002dadd1fe486d4152d923e50e5b767a6e1f46ef4838b504e3583d85210e14b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Security for liq 0.1.2
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.