#color-palette #lookup-tables #image-processing #color #color-themes #gaussian #hald-clut

bin+lib lutgen

A blazingly fast interpolated LUT utility for arbitrary and popular color palettes

28 releases

0.11.2 Oct 10, 2024
0.11.0 Sep 6, 2024
0.10.1 May 14, 2024
0.10.0 Mar 15, 2024
0.8.3 Jul 31, 2023

#86 in Images

Download history 45/week @ 2024-08-21 73/week @ 2024-08-28 174/week @ 2024-09-04 88/week @ 2024-09-11 206/week @ 2024-09-18 137/week @ 2024-09-25 58/week @ 2024-10-02 401/week @ 2024-10-09 97/week @ 2024-10-16 106/week @ 2024-10-23 58/week @ 2024-10-30 43/week @ 2024-11-06 64/week @ 2024-11-13 41/week @ 2024-11-20 80/week @ 2024-11-27 480/week @ 2024-12-04

670 downloads per month
Used in oculante

MIT and CC-PDDC licenses

4MB
1K SLoC


lutgen-rs

crate license publish ci

A blazingly fast interpolated LUT utility for arbitrary and popular color palettes. Theme any image to your desktop colorscheme!


Example Output

Hald Cluts

Catppuccin Mocha
Gruvbox Dark
Nord

Color Corrections

Original Image
Catppuccin Mocha
Gruvbox Dark
Nord

CLI

Installation

Packaging status

Source

git clone https://github.com/ozwaldorf/lutgen-rs
cd lutgen-rs
cargo install --path .

Nix flake

A nix flake is available and can be run easily with:

nix run github:ozwaldorf/lutgen-rs

Cache is provided via https://garnix.io

Documentation

Detailed cli documentation is available at docs/README.md.

Examples

Correcting an image

# Builtin palette
lutgen apply -p catppuccin-mocha docs/example-image.jpg -o mocha_version.jpg

# Custom colors
lutgen apply docs/example-image.jpg -- "#ABCDEF" ffffff 000000

# Custom palette file with whitespace separated hex colors (linux example shown)
echo "fff 555 000 abcdef deadbe" > ~/.config/lutgen/my-palette-name
lutgen apply docs/example-image.jpg -p my-palette-name

# Multiple images
lutgen apply image1.png image2.png *.jpg -p catppuccin-mocha

# Using an external LUT
lutgen apply --hald-clut mocha_lut.png docs/example-image.jpg

Generating a standalone LUT for external or manual usage

# Builtin palette
lutgen generate -p catppuccin-mocha -o mocha_lut.png

# Custom colors
lutgen generate -o custom.png -- "#ABCDEF" ffffff 000000

# Custom palette file with whitespace separated hex colors (linux example shown)
echo "fff 555 000 abcdef deadbe" > ~/.config/lutgen/my-palette-name
lutgen generate -p my-palette-name

Preview palletes

# Preview all palettes
lutgen palette all

# Copy a palette to the custom palette dir for modifying and overriding
lutgen palette carburetor > ~/.config/lutgen/carburetor

# Finding a palette name with grep
lutgen palette names | grep 'gruvbox'

Correcting videos (using ffmpeg):

ffmpeg -i input.mkv -i hald_clut.png -filter_complex '[0][1] haldclut' output.mp4

Zsh Completions:

lutgen --bpaf-complete-style-zsh > _lutgen
sudo mv _lutgen /usr/local/share/zsh/site-functions/

Library

See the latest documentation on docs.rs

Planned features

  • Interpolation for more accuracy when correcting with low level luts (<16)
  • Hardware acceleration for applying luts to images

Sources

Special Thanks

  • Stonks3141 for maintaining the Alpine Linux package
  • All the nixpkgs maintainers

Dependencies

~7–34MB
~527K SLoC