Colorspacious

1.1.2 · abandoned · verified Fri Apr 17

Colorspacious is a Python library providing robust and accurate tools for colorspace conversions. It supports a wide range of standard colorspaces (sRGB, CIELab, CIELCh, etc.) and is built to handle numerical data efficiently, especially with NumPy arrays. The current version is 1.1.2, but development has been inactive since 2018, placing it in an abandoned state.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates basic color space conversion using the `cspace_convert` function. It takes a NumPy array representing color data and converts it between specified input and output color spaces.

import colorspacious as cs
import numpy as np

# A color in sRGB255 (standard 0-255 sRGB) space
sRGB_color = np.array([255, 128, 0]) # Orange

# Convert to CIELab (D65 illuminant) space
LAB_color = cs.cspace_convert(sRGB_color, "sRGB255", "CIELab")
print(f"sRGB color (255, 128, 0) in CIELab: {LAB_color}")

# Convert to CIELCh space
LCH_color = cs.cspace_convert(LAB_color, "CIELab", "CIELCh")
print(f"sRGB color (255, 128, 0) in CIELCh: {LCH_color}")

view raw JSON →