Support for Color Exchange Format in Colour available!

We are happy to announce the release of Colour - CxF.

This extension package for Colour implements reading and writing files in the Color Exchange Format (CxF).

What is CxF?

CxF is a XML-based file format that provides a flexible way to store and exchange color data across different systems. It supports multiple color formats including RGB, CIELab, and spectral measurements, while providing standard ways to include metadata and descriptions about the color information.

Features

The Colour - CxF package allows

  • Reading CxF documents from strings or files to a Python representation.

  • Writing CxF documents from the Python representation to XML strings and files.

  • Creating CxF objects programmatically for custom color data workflows.

Getting started

Install Colour - CxF via pip:

pip install colour-cxf

or via uv:

uv add colour-cfx

Then use it to read CxF data:

import colour_cxf

# Reading from a string
xml_string = """
<?xml version="1.0" encoding="UTF-8"?>
<cc:CxF xmlns:cc="http://colorexchangeformat.com/CxF3-core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <cc:FileInformation>
        <cc:Creator>Colour Developers</cc:Creator>
        <cc:Description>Simple CxF Example</cc:Description>
    </cc:FileInformation>
</cc:CxF>
"""

# Parse the XML string
cxf = colour_cxf.read_cxf(xml_string.encode("utf-8"))

# Access file information
print(f"Creator: {cxf.file_information.creator}")
print(f"Description: {cxf.file_information.description}")

More Information

Visit the Colour - CxF repository for more information, usage examples and tutorials.

Funding

We would like to thank NumFOCUS for funding the work on this package through the The Small Development Grants program.

Comments

Comments powered by Disqus