skillfed

color-operations

Apply basic color-oriented image operations.

color-operations v0.2.0 325.1K downloads/30d#7,590 on PyPI13
Permissive license MIT Active released

What it is and what it does

color-operations is a fork of Mapbox's rio-color that provides color and contrast adjustment functions for image processing, with the rasterio dependency removed and Python 3.9+ support added. It operates on numpy arrays in rasterio band ordering (bands, columns, rows) and assumes input values scaled 0 to 1. The package exports functions for gamma adjustment (brightening/darkening midtones), sigmoidal contrast (non-linear brightness and contrast matching human perception), saturation adjustment (colorfulness control), and atmospheric correction. It also includes a colorspace module for converting between RGB, XYZ, LAB, LCH, and LUV color spaces, and a domain-specific language for composing chains of operations via operation strings.

The package is useful for satellite imagery enhancement—particularly reducing atmospheric haze in blue and green bands—and general image processing workflows where fine-grained control over tone curves and color intensity is needed. It is built with Cython for performance and provides both array-level and scalar-level colorspace conversion functions.

Use it for:

  • Enhance satellite or aerial imagery by reducing atmospheric haze and adjusting contrast in specific bands.
  • Apply gamma correction to brighten or darken image midtones without clipping shadows or highlights.
  • Adjust color saturation independently of brightness in RGB imagery by converting to and from perceptual color spaces.
  • Chain multiple color operations via operation strings (DSL) for reproducible image processing pipelines.
  • Convert image data between color spaces (RGB, LAB, LCH, etc.) for advanced color analysis or manipulation.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Applies color-oriented image operations—gamma adjustment, sigmoidal contrast, saturation, and atmospheric correction—to numpy arrays representing RGB imagery in rasterio band ordering.

Yes. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and solves a specific problem (color-oriented image operations on numpy arrays) with a shallow dependency tree. It is well-suited for satellite imagery and scientific image processing workflows. Install friction is moderate due to compiled wheels, but platform coverage is broad.

Install

color-operations on PyPI

pip

pip install color-operations

uv

uv add color-operations

poetry

poetry add color-operations

Installing color-operations

Before you install

Medium install friction due to compiled wheels for multiple Python versions and platforms (cp310–cp313, macOS, Linux, Windows). Maintenance is active with a recent commit on 2026-07-27 and stable status since initial release in 2022-11-09. Single runtime dependency on numpy keeps the dependency tree shallow.

License in practice

MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike.

Quickstart

pip install color-operations

from color_operations import parse_operations

arr = ...  # numpy array, shape (bands, columns, rows), values 0-1
ops = "gamma b 1.85, gamma rg 1.95, sigmoidal rgb 35 0.13, saturation 1.15"
for func in parse_operations(ops):
    arr = func(arr)

Input arrays must be in rasterio band ordering (bands, columns, rows) with values scaled 0 to 1.

Verify before relying

  • Whether the package's numerical accuracy has been validated against the original rio-color implementation.
  • Whether colorspace conversion functions handle edge cases or out-of-range values gracefully.
  • Availability of formal documentation beyond the GitHub README.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 505 days since the last release
Last repo commit
First released
Downloads 325,069/month — #7,590 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: color_operations-0.2.0-cp310-cp310-macosx_10_9_universal2.whl; color_operations-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl; color_operations-0.2.0-cp310-cp310-macosx_11_0_arm64.whl; color_operations-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; color_operations-0.2.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; color_operations-0.2.0-cp310-cp310-win_amd64.whl; color_operations-0.2.0-cp311-cp311-macosx_10_9_universal2.whl; color_operations-0.2.0-cp311-cp311-macosx_10_9_x86_64.whl; color_operations-0.2.0-cp311-cp311-macosx_11_0_arm64.whl; color_operations-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; color_operations-0.2.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; color_operations-0.2.0-cp311-cp311-win_amd64.whl; color_operations-0.2.0-cp312-cp312-macosx_10_13_universal2.whl; color_operations-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl; color_operations-0.2.0-cp312-cp312-macosx_11_0_arm64.whl; color_operations-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; color_operations-0.2.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; color_operations-0.2.0-cp312-cp312-win_amd64.whl; color_operations-0.2.0-cp313-cp313-macosx_10_13_universal2.whl; color_operations-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: CythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Multimedia :: Graphics :: Graphics ConversionTopic :: Scientific/Engineering :: GIS

Tags

image color correctiongamma adjustment numpysigmoidal contrastrgb saturation adjustmentsatellite image enhancementcolor space conversionatmospheric haze reduction
image-processingcolor-sciencenumpy-based

More GIS packages