Ultra-fast, palette-accurate colour-grading for images – powered by the Oxocarbon palette and written in OCaml/OxCaml.
You should probably use lutgen-rs, the output is the same, but this one is fun
ries-t2ries-t
med-gr-l-4
lar-gr-l-13
lar-gr-l-7
lar-gr-l-1
champ2
a-root-rtt-05-key
- One-time LUT build – A dense HALD‐4 lookup-table is generated once using Gaussian-RBF interpolation in Oklab space and cached.
- Blazing-fast processing – Allocation-free, inlined trilinear filtering & parallelism chew through whole folders of PNGs in seconds.
- Optional luminance weighting and preserve
A one-liner to obtain everything on a new switch:
opam update --all
opam switch create 5.2.0+ox --repos ox=git+https://github.com/oxcaml/opam-repository.git,default
eval $(opam env --switch 5.2.0+ox)
opam install -y ocamlformat merlin ocaml-lsp-server utop parallel core_unix
opam install -y imagelib domainslib
# inside the caida/ directory
make # compiles img_oxocarbon, runs on caida-original/ and puts results in out/
make run # builds (if needed) and colour-grades all PNGs in caida-original/ → out/
# or manually
ocamlfind ocamlopt -O3 -thread -unsafe \
-package imagelib.unix,domainslib -linkpkg \
-o img_oxocarbon img_oxocarbon.ml
./img_oxocarbon <input_dir> <output_dir>
Optionally use --invert
to invert the input image, --preserve
to preserve luminance, and set OXO_LUM_FACTOR
to adjust luminance
This project is vendored under the MIT liscense
The Oxocarbon palette belongs to its respective authors; used here under the same terms as the original theme.
- Björn Ottosson – Author of Oklab perceptual colour space.
- Ozwaldorf - Author of lutgen-rs
- Caida - Source of sample images