color-operations
Apply basic color-oriented image operations.
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-operationsuv
uv add color-operationspoetry
poetry add color-operationsInstalling 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
Tags
More GIS packages
Shapely provides Python tools for creating,…
permissive · top 1,000 on PyPI
pyprojpyproj provides a Python interface to PROJ,…
permissive · top 1,000 on PyPI
geopandasGeoPandas extends pandas DataFrames to handle…
permissive · top 1,000 on PyPI
geopygeopy is a Python client for geocoding and…
permissive · top 5,000 on PyPI
pyogrioPyogrio provides fast, bulk-oriented read and…
permissive · top 5,000 on PyPI
h3h3 provides Python bindings to Uber's H3…
permissive · top 5,000 on PyPI
epaper-ditheringConverts images to dithered output optimized…
permissive · top 15,000 on PyPI
pixeloeConverts standard images into pixel art using…
permissive · top 15,000 on PyPI
rasterioRasterio reads and writes geospatial raster…
permissive · top 5,000 on PyPI
colourConverts between and manipulates color…
permissive · top 5,000 on PyPI
colorzerocolorzero provides a simple, immutable color…
permissive · top 15,000 on PyPI
fastremapRemap, renumber, and relabel NumPy arrays at…
copyleft · top 15,000 on PyPI
skia-pathopsPython bindings for Google Skia's Path Ops…
permissive · top 15,000 on PyPI
rio-cogeorio-cogeo creates and validates Cloud Optimized…
permissive · top 15,000 on PyPI
coloraideColorAide is a pure Python library for…
permissive · top 15,000 on PyPI
numpy-rmsCalculates Root Mean Square (RMS) values over…
permissive · top 15,000 on PyPI