Skip to content

nyoom-engineering/oxocarbon-lutgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oxocarbon Image Batch Processor

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-t2

ries-t2

ries-t

ries-t

med-gr-l-4

med-gr-l-4

lar-gr-l-13

lar-gr-l-13

lar-gr-l-7

lar-gr-l-7

lar-gr-l-1

lar-gr-l-1

champ2

champ2

a-root-rtt-05-key

a-root-rtt-05-key

Features

  • 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

Installation

Dependencies

  • OxCaml
  • opam with the following libraries:
    • imagelib (imagelib.unix flavour)
    • domainslib

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

Run

# 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

License

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.

Acknowledgements

About

alette-accurate colour-grading for images against the Oxocarbon color palette

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published