Skip to main content

Reduces the size of images for the web.

Project description

CI : Docs CI : Lint CI : Tests PyPI : shrinkix Python : versions Discord License : MIT

Description

Reduces the size of images for the web.

Documentation

Documentation is available on https://dashstrom.github.io/shrinkix

Installation from scratch

Windows

Open an Admin PowerShell with windows + X, then press a.

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

MacOs and Linux

curl -LsSf https://astral.sh/uv/install.sh | sh

Package installation (All System)

You can install shrinkix using uv from PyPI

uv tool install shrinkix

Usage

Usage as script

shrinkix image.png --max-width 1024 --max-height 1024 --artist 'Dashstrom' --copyright 'dashstrom.pro@gmail.com'

Usage as module

from shrinkix import Shrinkix

shrinkix = Shrinkix(
    max_width=1024,
    max_height=1024,
    keep_metadata=False,
)
shrinkix.shrink("tests/resources/test.jpg", "test.png")

Development

Contributing

Contributions are very welcome. Tests can be run with poe check, please ensure the coverage at least stays the same before you submit a pull request.

Setup

You need to install uv and Git for work with this project.

git clone https://github.com/Dashstrom/shrinkix
cd shrinkix
uv sync
uv run poe setup

Poe

Poe is available for help you to run tasks.

test           Run test suite.
lint           Run linters: ruff checker and ruff formatter and mypy.
format         Run linters in fix mode.
check          Run all checks: lint, test and docs.
check-tag      Check if the current tag match the version.
cov            Run coverage for generate report and html.
open-cov       Open html coverage report in webbrowser.
docs           Build documentation.
open-docs      Open documentation in webbrowser.
setup          Setup pre-commit.
pre-commit     Run pre-commit.
commit         Test, commit and push.
clean          Clean cache files.

Skip commit verification

If the linting is not successful, you can’t commit. For forcing the commit you can use the next command :

git commit --no-verify -m 'MESSAGE'

Commit with commitizen

To respect commit conventions, this repository uses Commitizen.

cz c

How to add dependency

uv add 'PACKAGE'

Ignore illegitimate warnings

To ignore illegitimate warnings you can add :

  • # noqa: ERROR_CODE on the same line for ruff.

  • # type: ignore[ERROR_CODE] on the same line for mypy.

  • # pragma: no cover on the same line to ignore line for coverage.

  • # doctest: +SKIP on the same line for doctest.

Uninstall

pipx uninstall shrinkix

License

This work is licensed under 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

shrinkix-1.1.0rc1.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

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

shrinkix-1.1.0rc1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file shrinkix-1.1.0rc1.tar.gz.

File metadata

  • Download URL: shrinkix-1.1.0rc1.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for shrinkix-1.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 5d20f6c05d9a33be34b3a2306f2757eb4c2322f6c210bc45629de10d34dc9991
MD5 eb92f5250df2ca3132367ccf5fbc423f
BLAKE2b-256 f69d6bc14a935241ad40397d526eaa7675a50b1435854200be4ce019d07902af

See more details on using hashes here.

Provenance

The following attestation bundles were made for shrinkix-1.1.0rc1.tar.gz:

Publisher: publish.yml on Dashstrom/shrinkix

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

File details

Details for the file shrinkix-1.1.0rc1-py3-none-any.whl.

File metadata

  • Download URL: shrinkix-1.1.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for shrinkix-1.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe3a9ac6431794bf8be1f47d223eb03678c53a1df096259498b4f45ee91eae63
MD5 5ad1f3f6471ac92860d84455f237436a
BLAKE2b-256 0990feda79a5cd8df32f3bb6117de4a4ec88b66f7b42d3c28f7610766ffd7fb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for shrinkix-1.1.0rc1-py3-none-any.whl:

Publisher: publish.yml on Dashstrom/shrinkix

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