Skip to main content

A CLI tool to manipulate images in various ways

Project description

Eqlm

A CLI tool to manipulate images in various ways

Installation

pip install eqlm

With Clipboard Support

pip install eqlm[clipboard]

Note that the clipboard functionality depends heavily on the OS you are using.

Examples

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

Source Result
Input Image Output Image

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

Source Result
Input Image Output Image

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

Source Result
Input Image Output Image

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

Source Result
Input Image Output Image

Commands

The main program can be invoked either through the eqlm command or through the Python main module option python3 -m eqlm. Each operation is implemented as a subcommand shown below.

Eq

Spatially equalize image lightness, saturation, or brightness

usage: eqlm eq [-h] [-m {l,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]

Equalize image lightness, saturation, or brightness

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

options:
  -h, --help            show this help message and exit
  -m {l,brightness,saturation,lightness}, --mode {l,brightness,saturation,lightness}
                        processing mode (l: L (LAB), brightness: Brightness
                        (HSV), saturation: Saturation (HSV), lightness:
                        Lightness (HLS)) (default: l)
  -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 the 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)

A '--' is usable to terminate option parsing so remaining arguments are
treated as positional arguments.

Match

Match histogram of source image to reference image

usage: eqlm match [-h]
                  [-m {rgb,red,green,blue,lab,ab,l,brightness,saturation,lightness}]
                  [-a SOURCE REFERENCE | -u] [-g [GAMMA]] [-d {8,16}] [-s]
                  [-x]
                  SOURCE_FILE REFERENCE_FILE [OUT_FILE]

Match histogram of source image to reference image

positional arguments:
  SOURCE_FILE           source image file path (use '-' for stdin, '_' for
                        clipboard)
  REFERENCE_FILE        reference image file path (use '-' for stdin, '_' for
                        clipboard)
  OUT_FILE              output PNG image file path (use '-' for stdout, '_'
                        for clipboard) (default: AutoUnique)

options:
  -h, --help            show this help message and exit
  -m {rgb,red,green,blue,lab,ab,l,brightness,saturation,lightness}, --mode {rgb,red,green,blue,lab,ab,l,brightness,saturation,lightness}
                        processing mode (rgb: RGB, red: Red (RGB), green:
                        Green (RGB), blue: Blue (RGB), lab: LAB, ab: AB (LAB),
                        l: L (LAB), brightness: Brightness (HSV), saturation:
                        Saturation (HSV), lightness: Lightness (HLS))
                        (default: rgb)
  -a SOURCE REFERENCE, --alpha SOURCE REFERENCE
                        cutout threshold for the alpha channel (source,
                        reference) (default: (0.0, 0.5))
  -u, --unweighted      disable cutout based on the alpha channel (default:
                        False)
  -g [GAMMA], --gamma [GAMMA]
                        apply inverse gamma correction before the 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)

A '--' is usable to terminate option parsing so remaining arguments are
treated as positional arguments.

Laps

Sharpen an image using a Laplacian variant kernel

usage: eqlm laps [-h] [-m {rgb,red,green,blue,lab,ab,l}]
                 [-t {basic5,basic9,diagonal,oonopuri,patrakarttunen}] [-c C]
                 [-a] [-g [GAMMA]] [-d {8,16}] [-s] [-x]
                 IN_FILE [OUT_FILE]

Sharpen an image using a Laplacian variant kernel

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

options:
  -h, --help            show this help message and exit
  -m {rgb,red,green,blue,lab,ab,l}, --mode {rgb,red,green,blue,lab,ab,l}
                        processing channel mode (rgb: RGB, red: Red (RGB),
                        green: Green (RGB), blue: Blue (RGB), lab: LAB, ab: AB
                        (LAB), l: L (LAB)) (default: rgb)
  -t {basic5,basic9,diagonal,oonopuri,patrakarttunen}, --stencil {basic5,basic9,diagonal,oonopuri,patrakarttunen}
                        kernel selection (basic5: Basic5, basic9: Basic9,
                        diagonal: Diagonal, oonopuri: OonoPuri,
                        patrakarttunen: PatraKarttunen) (default: oonopuri)
  -c C, --coef C        sharpening factor (default: 0.2)
  -a, --include-alpha   also sharpen the alpha channel (default: False)
  -g [GAMMA], --gamma [GAMMA]
                        apply inverse gamma correction before the 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)

A '--' is usable to terminate option parsing so remaining arguments are
treated as positional arguments.

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-2.1.0.tar.gz (21.9 MB view details)

Uploaded Source

Built Distribution

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

eqlm-2.1.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eqlm-2.1.0.tar.gz
  • Upload date:
  • Size: 21.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for eqlm-2.1.0.tar.gz
Algorithm Hash digest
SHA256 57bb0ae7eb5da4a36bdebeb445e40e6277f303e14cb1fde00c74fb8ba54a7a3a
MD5 abd443582a4ec9fe6865f5e0dfaee5c7
BLAKE2b-256 08c56ad6a9ad1c24ca221636c4469995b7e27792978e42aecebaec0f510219b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eqlm-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for eqlm-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca5de09740814972c19d67188ca22d96777d81a3c49012ba4f6820c588b57e92
MD5 e41be6bd0669258e04c3b9f5788061ee
BLAKE2b-256 7c2c96ab388bdbc2cc8c65a6c4e860aa8e614062964c5bf1a0cfcf8308ea43e5

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