Estimate a .cube 3D lookup table from camera images for the Darktable lut 3D module.
Project description
This package estimates a .cube 3D lookup table (LUT) for use with the Darktable lut 3D module. It was designed to obtain 3D LUTs replicating in-camera jpeg styles. This is especially if one shoots large sets of RAW photos (e.g. for commission), where most shall simple resemble the standard out-of-camera (OOC) style when exported by darktable, while still being able to do some quick corrections on selected images while mainraining the OOC style.
Below is an example using an LUT estimated to match the Provia film simulation on a Fujifilm X-T3. First is the OOC Jpeg, second is the RAW processed in Darktable with the LUT and third is the RAW processed in Darktable without any corrections:
Installation
Python 3 must be installed.
Installation of Darktable LUT Generator via pip:
pip install darktable_lut_generator
Usage
Run:
darktable_lut_generator [path to directory with images] [output .cube file]
For help and further arguments, run
darktable_lut_generator --help
A direktory with image pairs of one RAW image and the corresponding OOC image (e.g. jpeg) is used as input. The images should represent a wide variety of colors; ideally, the whole Adobe RGB color space is covered. The resulting LUT is intended for application in Adobe RGB color space. Hence, it is advisable to also shoot the in-camera jpegs in Adobe RGB in order to cover the whole available gamut. In default configuration, Darktable may apply an exposure module with camera exposure bias correction automatically to raw files. The LUTs produced by this module are constructed to resemble the OOC jpeg when used on a raw image without the exposure bias correction. Also, the filmic rgb module should be turned off.
Estimation
Estimation is performed by estimating the differences to an identity LUT using linear regression with LASSO
regularization, assuming trilinear interpolation when applying the LUT.
Very sparsely or non-sampled colors will fallback to identity. However, no sophisticated hyperparameter tuning regarding
the LASSO parameter has been conducted, especially regarding different cube size.
n_samples
pixels are sampled from the image, as using all pixels is computationally expensive.
Sampling is performed weighted by the inverse estimated sample density conditioned on the raw pixel colors in order to
obtain a sample with approximately uniform distribution over the represented colors.
This reduces the needed sample count for good results by approx. an order of magnitude compared to drawing pixels
uniformly.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for darktable-lut-generator-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d656e40b8328b2ca0250727d1066910a398ddc556ca96bb680e6d3c8ac4e504e |
|
MD5 | 098bb89d70770453361a21824d40bd8c |
|
BLAKE2b-256 | a1404fa408218223797db3706182ca68c050e1d57d1f62854cdcaee3d14a6a57 |
Hashes for darktable_lut_generator-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2846e1244ab8d34825030357e337c4a660b43b3b1ccf1c9d6c988f9c7ad6146b |
|
MD5 | b007f144108087a348e01f57af1eb155 |
|
BLAKE2b-256 | c94515b66398cded6bba8612f582c10c6cfe04563ab3fed79ab3c5d1b89953be |