Support my work on Patreon

If you like my work, please consider to help my growing family with a little financial support through my Patreon creator page.


Alternatively, you can leave a one-time donation via PayPal using the Donate button below.

Total Pageviews

Friday, April 26, 2019

New shadows/highlights and tone-mapping tools

This post is still work in progress!!!

----------------

Introduction

This post describes the new shadows/highlights adjustment tool that I have introduced in PhotoFlow, and gives some implementation details in case someone would like to port the code to some other image editor.

The shadows/highlights adjustment can be split in the following steps:

  1. the input pixels are converted from linear RGB to log grayscale, to create a log-luminance (LL) mask:
    LL = log10(lumi(RGB))
  2. the LL mask is blurred with a guided filter pyramid (more on this below)
  3. the blurred LL mask is tone-mapped with an analytical function that rises the shadows and lowers the highlights (more on this below); an anchor parameter allows to define the splitting point between shadows and highlights regions
  4. the input RGB values are linearly scaled by the ratio of the blurred LL mask after/before the tone mapping

CSS image comparison slider test

Drag the black border ↔ pure Css

Credits:Original idea: solipsistaCP