Skip to content

Integrate ICC v5 / iccMAX Support into OpenCV #1153

@SaneRelapse

Description

@SaneRelapse

Dear OpenCV Maintainers,

I am writing to propose an enhancement to OpenCV’s color management capabilities: the integration of ICC v5 / iccMAX profile support. As imaging workflows increasingly rely on wide-gamut, high-dynamic-range content, modern color management standards are essential for accurate processing, visualization, and output.

Motivation
Current OpenCV workflows typically rely on ICC v2/v4 profiles and manual gamma approximations for wide-gamut color spaces (e.g., ProPhoto RGB, ROMM RGB) or HDR content. This approach has several limitations:

Limited channel support: Only 3-channel RGB is fully supported; multi-channel or spectral data cannot be handled.

Approximate gamma and clipping: Wide-gamut transforms require manual gamma adjustments, introducing artifacts and loss of fidelity.

No perceptual color appearance modeling: Viewing conditions, adaptation, and flare corrections are not considered.

Limited HDR support: Floating-point and extended dynamic range are only partially implemented, restricting true HDR workflows.

Proposed Upgrade
Integrate ICC v5 / iccMAX profile handling directly into OpenCV, leveraging:

Multi-channel LUTs and transforms: Accurate conversion between wide-gamut color spaces and high-bit-depth or spectral data.

High-precision floating-point processing: Maintain HDR, linear-light, and extended dynamic range data throughout pipelines.

Color appearance models (CAM02 / CAM16): Support perceptual transforms for soft-proofing and viewing condition adaptation.

Backward compatibility: Ensure existing workflows using v2/v4 profiles remain functional.

Benefits

Professional color accuracy: OpenCV would handle modern cinema cameras (RED, Arri, Blackmagic) and high-end photography workflows accurately.

HDR and wide-gamut support: True representation of HDR content without manual approximations.

Scientific and industrial applications: Enhanced precision for research, medical imaging, and machine vision systems.

Enhanced Python and C++ pipelines: Enable real-time processing of color-managed content for computer vision, machine learning, and display.

Improved dataset quality: Training datasets generated in OpenCV would more accurately reflect real-world color and lighting, improving model generalization.

Suggested Implementation

Integrate an ICC v5 parser and transform engine (e.g., leverage DemoIccMax / iccDEV).

Provide Python bindings for profile application in cv2.cvtColor() or a new cv2.colorProfileTransform() function.

Maintain internal floating-point representation for linear color processing.

Add support for perceptual adaptation and multi-channel LUTs.

Adding ICC v5 / iccMAX support would bring OpenCV to parity with professional imaging software and ensure Python, C++, and GPU-based pipelines can process true wide-gamut HDR content accurately. This upgrade would significantly benefit research, industrial, and machine vision applications, positioning OpenCV as a robust choice for modern imaging workflows.
Integrating the iccMAX ICC file by default

Thank you for considering this enhancement.
https://www.color.org/iccmax.xalter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions