ocio 0.3.0

A pure Rust port of OpenColorIO, the color management framework for visual effects and animation.
Documentation
ocio-0.3.0 has been yanked.

ocio-rs

A pure Rust port of OpenColorIO (OCIO), the color management framework for visual effects and animation.

The crate is named ocio. It has no C++ dependency, and its CPU renderers reproduce the results of OCIO built with SSE2 on every target.

Status

The port follows OCIO main between v2.5.0 and v2.6.0, and the library reports version 2.5.2. See UPSTREAM.md for the exact upstream revision and the changes still missing for v2.6.0, and PORTING.md for the architecture and the numerics notes.

What is covered:

  • Configs: YAML parsing and writing, contexts and environment variables, file rules, viewing rules, looks, named transforms, built-in configs and OCIOZ archives.
  • Transforms and ops: the OCIO transform set, op optimization, and a CPU processor working on interleaved RGBA f32.
  • File formats: the LUT and transform formats OCIO reads and writes (CLF/CTF, .cube, .spi1d, .spi3d, .3dl, ...), and LUT baking.
  • GPU shader text generation for GLSL, GLSL ES, Vulkan GLSL, HLSL, MSL, Cg, OSL and WGSL (for wgpu / WebGPU, see the ocio::gpu::wgsl module and the wgpu-example program). There is no GPU execution backend.

Usage

Add the crate to your Cargo.toml:

[dependencies]
ocio = "0.3"
use ocio::Config;

let config = Config::create_from_file("config.ocio").unwrap();
let processor = config.get_processor("ACEScg", "sRGB - Display").unwrap();
let cpu = processor.default_cpu_processor();
let mut pixel = [0.18f32, 0.18, 0.18];
cpu.apply_rgb(&mut pixel);

Command line tools

The tools workspace member (ocio-tools, not published) ports the OCIO applications:

Tool Purpose
ocioarchive Create, list and extract OCIOZ archives
ociobakelut Bake a color transform into a LUT
ociocheck Validate a config
ociochecklut Apply a LUT file to a color
ocioconvert Convert an image between color spaces
ociolutimage Convert between LUTs and LUT images
ociomakeclf Create a CLF file
ociomergeconfigs Merge configs
ocioperf Benchmark a transform
ociowrite Write a config or transform to a file

Run one with cargo run -p ocio-tools --release --bin ociocheck -- config.ocio.

Development

cargo test --all-targets
cargo test --doc

See CLAUDE.md for the testing conventions.

License

MIT AND BSD-3-Clause; see LICENSE.