Skip to main content

Simple CLI tool to spatially equalize image luminance

Project description

Eqlm

Simple CLI tool to spatially equalize image luminance, lightness, saturation, or brightness

Examples

$ eqlm images/macaron.jpg -n 3 2 -t 0.8 -c

Source Result
Input Image Output Image

$ eqlm images/mayuno.jpg -n 16 2 -t 0.7 -c -i makima

Source Result
Input Image Output Image

$ eqlm images/yaesu-wall.jpg -m lightness -t 0.9 -n 9 6

Source Result
Input Image Output Image

$ eqlm images/hakone.jpg -m saturation -t 0.2 --clamp

Source Result
Input Image Output Image

Install

pip3 install eqlm

Usage

The main program can be invoked either through the eqlm command or through the Python main module option python3 -m eqlm.

usage: eqlm [-h] [-v] [-m {luminance,brightness,saturation,lightness}]
            [-n M N] [-i {linear,cubic,akima,makima}] [-t RATE]
            [-c] [-e] [-u] [-g [GAMMA]] [-d {8,16}] [-s] [-x]
            IN_FILE [OUT_FILE]

Options

positional arguments:
  IN_FILE               input image file path (use '-' for stdin)
  OUT_FILE              output PNG image file path (use '-' for stdout)
                        (default: Auto)

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -m {luminance,brightness,saturation,lightness}
  --mode {luminance,brightness,saturation,lightness}
                        processing mode (default: luminance)
  -n M N, --divide M N  divide image into MxN (Horizontal x Vertical) blocks
                        for aggregation (default: (2, 2))
  -i {linear,cubic,akima,makima}, --interpolation {linear,cubic,akima,makima}
                        interpolation method (linear: Linear, cubic: CubicSpline,
                        akima: AkimaSpline, makima: ModifiedAkimaSpline)
                        (default: linear)
  -t RATE, --target RATE
                        set the target rate for the output level, ranging from
                        0.0 (minimum) to 1.0 (maximum) (default: Average)
  -c, --clamp           clamp the level values in extrapolated boundaries
                        (default: False)
  -e, --median          aggregate each block using median instead of mean
                        (default: False)
  -u, --unweighted      disable weighting based on the alpha channel
                        (default: False)
  -g [GAMMA], --gamma [GAMMA]
                        apply inverse gamma correction before process
                        [GAMMA=2.2] (default: None)
  -d {8,16}, --depth {8,16}
                        bit depth of the output PNG image (default: 8)
  -s, --slow            use the highest PNG compression level (default: False)
  -x, --no-orientation  ignore the Exif orientation metadata (default: False)

License

GNU Affero General Public License v3.0 or later

Copyright (C) 2025 curegit

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

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

eqlm-1.2.0.tar.gz (21.3 MB view details)

Uploaded Source

Built Distribution

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

eqlm-1.2.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file eqlm-1.2.0.tar.gz.

File metadata

  • Download URL: eqlm-1.2.0.tar.gz
  • Upload date:
  • Size: 21.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for eqlm-1.2.0.tar.gz
Algorithm Hash digest
SHA256 7831a7973377b752910c40c03da4922f6db5a6a4ad217457d8689a608c8ad30b
MD5 2a1c445410d8941a30af8cb399a8eac7
BLAKE2b-256 79aba53fea992344ccd59ba528cc0fc8cdb025173424f34680d419b176c3c210

See more details on using hashes here.

File details

Details for the file eqlm-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: eqlm-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for eqlm-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c157e6ce942f6851729ec5a68c39fb2831ab348dc073d3e5f069bb3c3c96129
MD5 193537b6283277fad2a4d597cc27a5b9
BLAKE2b-256 adaa68c768c484f129fe4b61333560d2674178da6cac3bf333f26cd8a72f3b2f

See more details on using hashes here.

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