Magic Lantern Forum

Using Magic Lantern => Raw Video => Raw Video Postprocessing => Topic started by: so-rose on September 06, 2016, 12:11:04 AM

Title: openlut: practical, OSS tools for color management!
Post by: so-rose on September 06, 2016, 12:11:04 AM
Hello!

As I was developing color management for convmlv, I ran into a lack a lack of free/OS tools to handle and apply LUTs (especially 1D LUTs), Color Matrices (for gamut transforms), and just simple gamma functions, to/from production image formats (especially 16-bit EXR files). I will be updating convmlv to use this soon.

Essentially, this solves that problem as a Python 3.5+ library for practical color management ("apply this LUT to this image and save it!"). Take a look at the feature list!

A big thanks to @Danne and @bouncyball for testing & feedback :) !

Download

Download the zip from GitHub: https://github.com/so-rose/openlut

Features
Code: [Select]
* Functional/OOP design scales from simple one-liners to complex systems.
* Load & save images in countless formats, including EXR and DPX, at up to 16 bits per pixel. The guts (numpy array) are easily accessible.
* Create 1D LUTs easily, from arbitrary contrast functions, arbitrary mappings, and more.
* Load and save 1D LUTs in the .cube format.
* Create, compose, invert, combine, and apply color matrices easily for gamut transformations.
* Apply any Transform, including LUTs, Matrices, and perfect Gamma functions, to any loaded image with ease (the .apply() method).
* Batteries included - comes with an image viewer, functions for sRGB, sLog2, Reinhard, Rec709, and more, as well as matrices for XYZ, sRGB, and Adobe RGB.
* Fast - transforms themselves are done in parallel C++ bound to Python.

More to come! Make a feature request as an issue on GitHub.

Info

See the GitHub page for the latest info on dependencies and usage. I'd rather just maintain that than also maintain this post :) .

I suggest looking at the test code at the bottom of the GitHub page.

If you need 3D LUT support today, take a look at pylut (https://pypi.python.org/pypi/pylut). It should fit your needs!

Plans

See Issues in GitHub for a more comprehensive list.

Feedback
I'd appreciate any feedback and testing (especially bugs)! I'm very happy to try feature requests too (within time & reason, naturally).