--- id: color-operations version: "0.2.0" license: MIT license_treatment: permissive maintenance: active --- # color-operations — Apply basic color-oriented image operations. License: permissive · Maintenance: active · Downloads: 325.1K/mo ## 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 above — 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 pip install color-operations uv add color-operations 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_current - Install friction: medium - Maintenance: active - Downloads: 325.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags image color correction, gamma adjustment numpy, sigmoidal contrast, rgb saturation adjustment, satellite image enhancement, color space conversion, atmospheric haze reduction, image-processing, color-science, numpy-based [View on SkillFed](https://skillfed.io/packages/color-operations) · [View on PyPI](https://pypi.org/project/color-operations/)