Wednesday, December 04, 2019

Tones and Tints ~ Creating Look-Up Tables (LUTs) for use in RawTherapee

Background ~

About a year ago I started to have trouble with a hard-drive that was failing on my super-fast laptop.  My father's HP (different model than mine) did the same thing a year earlier.  Maybe HP laptops overheat the hard-drive?  Or perhaps they had a long run of "bad" drives?

Fed up and disgusted with how Microsoft Windows rots from the inside out and how HP buries it's hard-drives deep into their laptops, I jettisoned the whole thing and returned to my roots.  One of the things I did in my work life was bring Linux to software developer's attention.  In this case it was easy for me to grab a slow, under-powered, and unused Dell laptop and load it with Linux and have it perform decently.

I have used the Gimp for over fourteen years and am used to Open Source Software.  The biggest restrictions for me with the Gimp is it's inability to open RAW files and to work in anything but at an 8-bit color depth.

The Gimp offers at least two useful approaches to change a base image's colors, "Sample Colorize" and a wide range of options implemented in G'Mic (Color Presets, Color Grading, Film Emulation). 

Around the time my Win10 HP box was causing trouble I downloaded RawTherapee.  It opens a vast variety of RAW formats and provides a default color depth of 16bits.  While at first it seemed difficult to understand and use, I quickly caught on.  Naturally one of the first goals I was to emulate film tones in the RawTherappe 16bit space.

Fortunately G'Mic has a set of emulations for RawTherapee.  I installed them, but instantly wished for more.  There are some really interesting LUTs in G'Mic Color Presets on the Gimp and over the years I have created some nice color samples from beautifully tinted black and white photographs.  These are what I wanted over in RawTherapee.


LUT creation and transfer ~ 

Using the (privacy) Force I did a bit of research and quickly understood how I could transfer some of the Color Presets and film emulations I like as well as my black and white tints from the Gimp into RawTherapee.   

I used the following materials -
  • Linux Mint OS (any Linux distribution should do - and something similar should be achievable with Windoze and Apple)
  • A copy of the base 12 or 16 bit HaldCLUT image to work from (the LUT base)
  • the Gimp (in my case v2.10)
    • G'Mic installed (the latest version)
    • black and white Sample Colorized step wedges
  • RawTherapee
    • G'Mic film emulations (used for its directory structure if you don't want to create your own - besides the G'Mic film emulations are a pretty nice place to start)

To transfer LUTs or Film Emulations from the Gimp -
  • Open an unaltered base LUT in the Gimp
  • Open G'Mic -> Color -> Color Presets
  • Apply the desired Color Preset to the open LUT image
    • NOTE: I like to keep the default layer active and have G'Mic write the changed color pattern as a new (inactive) layer.  That way I don't have to destroy and re-open the base image.  
  •  Keeping G'Mic open, move to the Gimp after the new LUT layer is available and save the Color Preset modified layer named as something meaningful to you and in .png format (this is essential)
  • Repeat these last two steps for as many Color Presets as you would like to transfer into RawTherapee

To create black and white tint LUTs in the Gimp -
  • Open an unaltered base LUT in the Gimp
  • Open Color -> Map -> Sample Colorize
  • Sample Colorize the open LUT image using a BW tint step wedge
    • NOTE: I like to make a copy of the base as a new layer and Sample Colorize the new layer.  That way I don't have to destroy and re-open the base image.  
  • Save the Sample Colorized LUT layer named as something meaningful to you and in .png format (this is essential)
  • Repeat these last two steps for as many Color Presets as you would like to transfer into RawTherapee

Making these updated LUTs available in RawTherapee -
  • Verify the location of the LUT directory you have pointed RawTherapee to
    • If you're not sure where the film emulations are found, open RawTherapee -> open Settings and note the LUT directory location
  • Using a terminal or, better, Folder view, Change Directory to the LUT directory and note there are (at least) two sub-directories inside the HaldCLUT directory
    • Color
    • Black and White
  • Inside each of these directories are further sub-sub-directories.   At this point you can choose an existing sub-sub-directory, or, as in my case, create new sub-sub-directories using a meaningful naming convention (such as GimpLUTs or anything that differentiates your new LUTs from the existing collection)
  • Copy your newly created .png LUTs from their current locations into the new RawTherapee directory structure locations.
  • Restart RawTherapee if it's still for some reason open
  • Go to Film Emulations and verify your new LUTs are where you expected them to be
  • Open an image file and apply your new LUTs to verify they look like they did in the Gimp
If you are fluent in Linux system and application management you will quickly recognize there are several ways of achieving similar results.  What I've tried to provide here is a recipe based on an existing directory structure, that being provided by G'Mic.  Of course you can create your own directory structure and forego the use of G'Mic altogether.  Just point RawTherapee at your top directory and the system should be able to understand your intent.

No comments: