Reading view

PhotoFlow Blended Panorama Tutorial


PhotoFlow Blended Panorama Tutorial

Andrea Ferrero has been busy!

After quite a bit of back and forth I am quite happy to be able to announce that the latest tutorial is up: A Blended Panorama with PhotoFlow! This contribution comes from Andrea Ferrero, the creator of a new project: PhotoFlow.

In it, he walks through a process of stitching a panorama together using Hugin and blending multiple exposure options through masking in PhotoFlow (see lede image). The results are quite nice and natural looking!

Local Contrast Enhancement: Gaussian vs. Bilateral

Andrea also runs through a quick video comparison of doing LCE using both a Gaussian and Bilateral blur, in case you ever wanted to see them compared side-by-side:

He started a topic post about it in the forums as well.

Thoughts on the Main Page

Over on discuss I started a thread to talk about some possible changes to the main page of the site.

Specifically I’m talking about the background lede image at the very top of the main page:

I had originally created that image as a placeholder in Blender. The site is intended as a photography-centric site, so the natural thought was why not use photos as a background instead?

The thought is to rotate through images as provided by the community. I’ve also mocked up two version of using an image as a background.

Simple replacement of the image with photos from the community. This is the most popular in the poll on the forum at the moment. The image will be rotated amongst images provided by community members. I just need to make sure that the text shown is legible over whatever the image may be…

Full viewport splash version, where the image fills the viewport. This is not very popular from the feedback I received (thank you akk, ankh, muks, DrSlony, LebedevRI, and others on irc!). I personally like the idea but I can understand why others may not like it.

If anyone wants to chime in (or vote in the poll) then head over to the forum topic and let us know your thoughts!

Also, a big thank you to Morgan Hardwood for allowing us to use that image as a background example. If you want a nice way to support F/OSS development, it just so happens that Morgan is a developer for RawTherapee, and a print of that image is available for purchase. Contact him for details.

A Blended Panorama with PhotoFlow


A Blended Panorama with PhotoFlow

Creating panoramas with Hugin and PhotoFlow

The goal of this tutorial is to show how to create a sort-of-HDR panoramic image using only Free and Open Source tools. To explain my workflow I will use the image below as an example.

This panorama was obtained from the combination of six views, each consisting of three bracketed shots at -1EV, 0EV and +1EV exposure. The three exposures are stitched together with the Hugin suite, and then exposure-blended with enfuse. The PhotoFlow RAW editor is used to prepare the initial images and to finalize the processing of the assembled panorama. The final result of the post-processing is below:

Final result
Final result of the panorama editing (click to compare to simple +1EV exposure)

In this case I have used the brightest image for the foreground, the darkest one for the sky and clouds, and and exposure-fused one for a seamless transition between the two.

The rest of the post will show how to get there…

Before we continue, let me advise you that I’m not a pro, and that the tips and “recommendations” that I’ll be giving in this post are mostly derived from trial-and-error and common sense. Feel free to correct/add/suggest anything… we are all here to learn!

Taking the shots

Shooting a panorama requires a bit of preparation and planning to make sure that one can get the best out of Hugin when stitching the shots together. Here is my personal “checklist”:

  • Manual Focus - set the camera to manual focus, so that the focus plane is the same for all shots
  • Overlap Shots - make sure that each frame has sufficient overlap with the previous one (something between 1/2 and 1/3 of the total area), so that hugin can find enough control points to align the images and determine the lens correction parameters
  • Follow A Straight Line - when taking the shots, try to follow as much as possible a straight line (keeping for example the horizon at the same height in your viewfinder); if you have a tripod, use it!
  • Frame Appropriately - to maximize the angle of view, frame vertically for an horizontal panorama (and vice-versa for a vertical one)
  • Leave Some Room - frame the shots a bit wider than needed, to avoid bad surprises when cropping the stitched panorama
  • Fixed Exposure - take all shots with a fixed exposure (manual or locked) to avoid luminance variations that might not be fully compensated by hugin
  • Bracket if Needed - if you shoot during a sunny day, the brightness might vary significantly across the whole panorama; in this case, take three or more bracketed exposures for each view (we will see later how to blend them in the post-processing)

Processing the RAW files

If you plan to create the panorama starting from the in-camera Jpeg images, you can safely skip this section. On the other hand, if you are shooting RAW you will need to process and prepare all the input images for Hugin. In this case it is important to make sure that the RAW processing parameters are exactly the same for all the shots. The best is to adjust the parameters on one reference image, and then batch-process the rest of the images using those settings.

Using PhotoFlow

Loading and processing a RAW file is rather easy:

  1. Click the “Open” button and choose the appropriate RAW file from your hard disk; the image preview area will show at this point a grey and rather dark image

  2. Add a “RAW developer” layer; a configuration dialog will show up which allows to access and modify all the typical RAW processing parameters (white balance, exposure, color conversion, etc… see screenshots below).

More details on the RAW processing in PhotoFlow can be found in this tutorial.

Once the result is ok the RAW processing parameters need to be saved into a preset. This can be done following a couple of simple steps:

  1. Select the “RAW developer” layer and click on the “Save” button below the layers list widget (at the bottom-right of the photoflow’s window)

  2. A file chooser dialog chooser dialog will pop-up, where one has to choose an appropriate file name and location for the preset and then click “Save”;
    the preset file name must have a “.pfp” extension

The saved preset needs then to be applied to all the RAW files in the set. Under Linux, PhotoFlow comes with an handy script that automates the process. The script is called pfconv and can be found here. It is a wrapper around the pfbatch and exiftool commands, and is used to process and convert a bunch of files to TIFF format. Save the script in one of the folders included in your PATH environment variable (for example /usr/local/bin) and make it executable:

sudo chmod u+x /usr/local/bin/pfconv

Processing all RAW files of a given folder is quite easy. Assuming that the RAW processing preset is stored in the same folder under the name raw_params.pfp, run this commands in your preferred terminal application:

cd panorama_dir
pfconv -p raw_params.pfp *.NEF

Of course, you have to change panorama_dir to your actual folder and the .NEF extension to the one of your RAW fles.

Now go for a cup of coffee, and be patient… a panorama with three or five bracketed shots for each view can easily have more than 50 files, and the processing can take half an hour or more. Once the processing completed, there will be one tiff file for each RAW image, an the fun with Hugin can start!

Assembling the shots

Hugin is a powerful and free software suite for stitching multiple shots into a seamless panorama, and more. Under Linux, Hugin can be usually installed through the package manager of your distribution. In the case of Ubuntu-based distros it can be usually installed with:

sudo apt-get install hugin

If you are running Hugin for the first time, I suggest to switch the interface type to Advanced in order to have full control over the available parameters.

The first steps have to be done in the Photos tab:

  1. Click on Add images and load all the tiff files included in your panorama. Hugin should automatically determine the lens focal length and the exposure values from the EXIF data embedded in the tiff files.

  2. Click on Create control points to let hugin determine the anchor points that will be used to align the images and to determine the lens correction parameters so that all shots overlap perfectly. If the scene contains a large amount of clouds that have likely moved during the shooting, you can try setting the feature matching algorithm to cpfind+celeste to automatically exclude non-reliable control points in the clouds.

  3. Set the geometric parameters to Positions and Barrel Distortion and hit the Calculate button.

  4. Set the photometric parameters to High dynamic range, fixed exposure (since we are going to stitch bracketed shots that have been taken with fixed exposures), and hit the Calculate button again.

At this point we can have a first look at the assembled panorama. Hugin provides an OpenGL-based previewer that can be opened by clicking on the on the GL icon in the top toolbar (marked with the arrow in the above screenshot). This will open a window like this:

If the shots have been taken handheld and are not perfectly aligned, the panorama will probably look a bit “wavy” like in my example. This can be easily fixed by clicking on the Straighten button (at the top of the Move/Drag tab). Next, the image can be centered in the preview area with the Center and Fit buttons.

If the horizon is still not straight, you can further correct it by dragging the center of the image up or down:

At this point, one can switch to the Projection tab and play with the different options. I usually find the Cylindrical projection better than the Equirectangular that is proposed by default (the vertical dimension is less “compressed”). For architectural panoramas that are not too wide, the Rectilinear projection can be a good option since vertical lines are kept straight.

If the projection type is changed, one has to click once more on the Center and Fit buttons.

Finally, you can switch to the Crop tab and click on the HDR Autocrop button to determine the limits of the area containing only valid pixels.

We are now done with the preview window; it can be closed and we can go back to the main window, in the Stitcher tab. Here we have to set the options to produce the output images the way we want. The idea is to blend each bracketed exposure into a separate panorama, and then use enfuse to create the final exposure-blended version. The intermediate panoramas, which will be saved along with the enfuse output, are already aligned with respect to each other and can be combined using different type of masks (luminosity, gradients, freehand, etc…).

The Stitcher tab has to be configured as in the image below, selecting Exposure fused from any arrangement and Blended layers of similar exposure, without exposure correction. I usually set the output format to TIFF to avoid compression artifacts.

The final act starts by clicking on the Stitch! button. The input images will be distorted, corrected for the lens vignetting and blended into seamless panoramas. The whole process is likely to take quite long, so it is probably a good opportunity for taking a pause…

At the end of the processing, few new images should appear in the output directory: one with an “_blended_fused.tif” suffix containing the output of the final enfuse step, and few with an “exposure????.tif” suffix that contain intermediate panoramas for each exposure value.

Blending the exposures

Very often, photo editing is all about getting what your eyes have seen out of what your camera has captured.

The image that will be edited through this tutorial is no exception: the human vision system can “compensate” large luminosity variations and can “record” scenes with a wider dynamic range than your camera sensor. In the following I will attempt to restore such large dynamics by combining under- and over-exposed shots together, in a way that does not produce unpleasing halos or artifacts. Nevertheless, I have intentionally pushed the edit a bit “over the top” in order to better show how far one can go with such a technique.

This second part introduces a certain number of quite general editing ideas, mixed with details specific to their realization in PhotoFlow. Most of what is described here can be reproduced in GIMP with little extra effort, but without the ease of non-destructive editing.

The steps that I followed to go from one to the other can be more or less outlined like that:

  1. take the foreground from the +1EV version and the clouds from the -1EV version; use the exposure-blended Hugin output to improve the transition between the two exposures

  2. apply an S-shaped tonal curve to increase the overall brightness and add contrast.

  3. apply a combination of the a and b channels of the CIE-Lab colorspace in overlay blend mode to give more “pop” to the green and yellow regions in the foreground

The image below shows side-by-side three of the output images produced with Hugin at the end of the first part. The left part contains the brightest panorama, obtained by blending the shots taken at +1EV. The right part contains the darkest version, obtained from the shots taken at -1EV. Finally, the central part shows the result of running the enfuse program to combine the -1EV, 0EV and +1EV panoramas.

Comparison between the +1EV exposure (left), the enfuse output (center) and the -1EV exposure (right)

Exposure blending in general

In scenes that exhibit strong brightness variations, one often needs to combine different exposures in order to compress the dynamic range so that the overall contrast can be further tweaked without the risk of losing details in the shadows or highlights.

In this case, the name of the game is “seamless blending”, i.e. combining the exposures in a way that looks natural, without visible transitions or halos. In our specific case, the easiest thing would be to simply combine the +1EV and -1EV images through some smooth transition, like in the example below.

Simple blending of the +1EV and -1EV exposures

The result is not too bad, however it is very difficult to avoid some brightening of the bottom part of the clouds (or alternatively some darkening of the hills), something that will most likely look artificial even if the effect is subtle (our brain will recognize that something is wrong, even if one cannot clearly explain the reason…). We need something to “bridge” the two images, so that the transition looks more natural.

At this point it is good to recall that the last step performed by Hugin was to call the enfuse program to blend the three bracketed exposures. The enfuse output is somehow intermediate between the -1EV and +1EV versions, however a side-by-side comparison with the 0EV image reveals the subtle and sophisticated work done by the program: the foreground hill is brighter and the clouds are darker than in the 0EV version. And even more importantly, this job is done without triggering any alarm in your brain! Hence, the enfuse output is a perfect candidate to improve the transition between the hill and the sky.

Final result
Enfuse output (click to see 0EV version)

Exposure blending in PhotoFlow

It is time to put all the stuff together. First of all, we should open PhotoFlow and load the +1EV image. Next we need to add the enfuse output on top of it: for that you first need to add a new layer (1) and choose the Open image tool from the dialog that will open up (2)(see below).

Inserting as image from disk as a layer

After clicking the “OK” button, a new layer will be added and the corresponding configuration dialog will be shown. There you can choose the name of the file to be added; in this case, choose the one ending with “_blended_fused.tif” among those created by Hugin:

“Open image” tool dialog

Layer masks: theory (a bit) and practice (a lot)

For the moment, the new layer completely replaces the background image. This is not the desired result: instead, we want to keep the hills from the background layer and only take the clouds from the “_blended_fused.tif” version. In other words, we need a layer mask.

To access the mask associated to the “enfuse” layer, double-click on the small gradient icon next to the name of the layer itself. This will open a new tab with an initially empty stack, where we can start adding layers to generate the desired mask.

How to access the grayscale mask associated to a layer

In PhotoFlow, masks are edited the same way as the rest of the image: through a stack of layers that can be associated to most of the available tools. In this specific case, we are going to use a combination of gradients and curves to create a smooth transition that follows the shape of the edge between the hills and the clouds. The technique is explained in detail in this screencast.

To avoid the boring and lengthy procedure of creating all the necessary layers, you can download this preset file and load it as shown below:

The mask is initially a simple vertical linear gradient. At the bottom (where the mask is black) the associated layer is completely transparent and therefore hidden, while at the top (where the mask is white) the layer is completely opaque and therefore replaces anything below it. Everywhere in between, the layer has a degree of transparency equal to the shade of gray in the mask.

In order to show the mask, activate the “show active layer” radio button below the preview area, and then select the layer that has to be visualized. In the example above, I am showing the output of the topmost layer in the mask, the one called “transition”. Double-clicking on the name of the “transition layer allows to open the corresponding configuration dialog, where the parameters of the layer (a curves adjustment in this case) can be modified. The curve is initially a simple diagonal: output values exactly match input ones.

If the rightmost point in the curve is moved to the left, and the leftmost to the right, it is possible to modify the vertical gradient and the reduce the size of the transition between pure black and pure white, as shown below:

We are getting closer to our goal of revealing the hills from the background layer, by making the corresponding portion of the mask purely black. However, the transition we have obtained so far is straight, while the contour of the hills has a quite complex curvy shape… this is where the second curves adjustment, associated to the “modulation” layer, comes into play.

As one can see from the screenshot above, between the bottom gradient and the “transition” curve there is a group of three layers: an horizontal gradient, a modulation curve and invert operation. Moreover, the group itself is combined with the bottom vertical gradient in grain merge blending mode.

Double-clicking on the “modulation” layer reveals a tone curve which is initially flat: output values are always 50% independently of the input. Since the output of this “modulation” curve is combined with the bottom gradient in grain merge mode, nothing happens for the moment. However, something interesting happens when a new point is added and dragged in the curve: the shape of the mask matches exactly the curve, like in the example below.

The sky/hills transition

The technique introduced above is used here to create a precise and smooth transition between the sky and the hills. As you can see, with a sufficiently large number of points in the modulation curve one can precisely follow the shape of the hills:

The result of the blending looks like that (click the image to see the initial +1EV version):

Final result
Enfuse output blended with the +1EV image (click to see the initial +1EV version)

The sky looks already much denser and saturated in this version, and the clouds have gained in volume and tonal variations. However, the -1EV image looks even better, therefore we are going to take the sky and clouds from it.

To include the -1EV image we are going to follow the same procedure done already in the case of the enfuse output:

  1. add a new layer of type “Open image” and load the -1EV Hugin output (I’ve named this new layer “sky”)

  2. open the mask of the newly created layer and add a transition that reveals only the upper portion of the image

Fortunately we are not obliged to recreate the mask from scratch. PhotoFlow includes a feature called layer cloning, which allows to dynamically copy the content of one layer into another one. Dynamically in the sense that the pixel data gets copied on the fly, such that the destination always reflects the most recent state of the source layer.

After activating the mask of the “sky” layer, add a new layer inside it and choose the “clone layer” tool (see screenshot below).

Cloning a layer from one mask to another

In the tool configuration dialog that will pop-up, one has to choose the desired source layer among those proposed in the list under the label “Layer name”. The generic naming scheme of the layers in the list is “[root group name]/root layer name/OMap/[mask group name]/[maks layer name]”, where the items inside square brackets are optional.

Choice of the clone source layer

In this specific case, I want to apply a smoother transition curve to the same base gradient already used in the mask of the “enfuse” layer. For that we need to choose “enfuse/OMap/gradient modulation (blended)” in order to clone the output of the “gradient modulation” group after the grain merge blend, and then add a new curves tool above the cloned layer:

The final transition mask between the hills and the sky

The result of all the efforts done up to now is shown below; it can be compared with the initial starting point by clicking on the image itself:

Final result
Edited image after blending the upper portion of the -1EV version through a layer mask. Click to see the initial +1EV image.

Contrast and saturation

We are not quite done yet, as the image is still a bit too dark and flat, however this version will “tolerate” some contrast and luminance boost much better than a single exposure. In this case I’ve added a curves adjustment at the top of the layer’s stack, and I’ve drawn an S-shaped RGB tone curve as shown below:

The effect of this tone curve is to increase the overall brightness of the image (the middle point is moved to the left) and to compress the shadows and highlights without modifying the black and white points (i.e. the extremes of the curve). This curve definitely gives “pop” to the image (click to see the version before the tone adjustment):

Final result
Result of the S-shaped tonal adjustment (click the image to see the version before the adjustment).

However, this comes at the expense of an overall increase in the color saturation, which is a typical side effect of RGB curves. While this saturation boost looks quite nice in the hills, the effect is rather disastrous in the sky. The blue as turned electric, and is far from what a nice, saturated blue sky should look like!

However, there is a simple fix to this problem: change the blend mode of the curves layer from Normal to Luminosity. The tone curve in this case only modified the luminosity of the image, but preserves as much as possible the original colors. The difference between normal and lumnosity blending is shown below (click to see the Normal blending). As one can see, the Luminosity blend tends to produce a duller image, therefore we will need to fix the overall saturation in the next step.

Luminosity blend
S-shaped tonal adjustment with Luminosity blend mode (click the image to see the version with Normal blend mode).

To adjust the overall saturation of the image, let’s now add an Hue/Saturation layer above the tone curve and set the saturation value to +50. The result is shown below (click to see the Luminosity blend output).

Saturation boost
Saturation set to +50 (click the image to see the Luminosity blend output).

This definitely looks better on the hills, however the sky is again “too blue”. The solution is to decrease the saturation of the top part through an opacity mask. In this case I have followed the same steps as for the mask of the sky blend, but I’ve changed the transition curve to the one shown here:

Saturation mask

In the bottom part the mask is perfectly white, and therefore a +50 saturation boost is applied. On the top the mask is instead just about 30%, and therefore the saturation is increased of only about +15. This gives a better overall color balance to the whole image:

Saturation boost after mask
Saturation set to +50 through a transition mask (click the image to see the Luminosity blend output).

###Lab blending The image is already quite ok, but I still would like to add some more tonal variations in the hills. This could be done with lots of different techniques, but in this case I will use one that is very simple and straightforward, and that does not require any complex curve or mask since it uses the image data itself. The basic idea is to take the a and/or b channels of the Lab colorspace, and combine them with the image itself in Overlay blend mode. This will introduce tonal variations depending on the color of the pixels (since the a and b channels only encode the color information). Here I will assume you are quite familiar wit the Lab colorspace. Otherwise, here is the link to the Wikipedia page that should give you enough informations to follow the rest of the tutorial.

Looking at the image, one can already guess that most of the areas in the hills have a yellow component, and will therefore be positive in the b channel, while the sky and clouds are neutral or strongly blue, and therefore have b values that are negative or close to zero. The grass is obviously green and therefore negative in the a channel, while the wineyards are brownish and therefore most likely with positive a values. In PhotoFlow the a and b values are re-mapped to a range between 0 and 100%, so that for example a=0 corresponds to 50%. You will see that this is very convenient for channel blending.

My goal is to lighten the green and the yellow tones, to create a better contrast around the wineyards and add some “volume” to the grass and trees. Let’s first of all inspect the a channel: for that, we’ll need to add a group layer on top of everything (I’ve called it “ab overlay”) and then added a clone layer inside this group. The source of the clone layer is set to the a channel of the “backgroud” layer, as shown in this screenshot:

a channel clone
Cloning of the Lab “a” channel of the background layer

A copy of the a channel is shown below, with the contrast enhanced to better see the tonal variations (click to see the original versions):

Saturation boost after mask
The Lab a channel (boosted contrast)

As we have already seen, in the a channel the grass is negative and therefore looks dark in the image above. If we want to lighten the grass we therefore need to invert it, to obtain this:

Saturation boost after mask
The inverted Lab a channel (boosted contrast)

Let’s now consider the b channel: as sursprising as it might seem, the grass is actually more yellow than green, or at least the b channel values in the grass are higher than the inverted a values. In addition, the trees at the top of the hill stick nicely out of the clouds, much more than in the a channel. All in all, a combination of the two Lab channels seems to be the best for what we want to achieve.

With one exception: the blue sky is very dark in the b channel, while the goal is to leave the sky almost unchanged. The solution is to blend the b channel into the a channel in Lighten mode, so that only the b pixels that are lighter than the corresponding a ones end up in the blended image. The result is shown below (click on the image to see the b channel).

b channel lighten blend
b channel blended in Lighten mode (boosted contrast, click the image to see the b channel itself).

And this are the blended a and b channels with the original contrast:

b channel lighten blend
The final a and b mask, without contrast correction

The last act is to change the blending mode of the “ab overlay” group to Overlay: the grass and trees get some nice “pop”, while the sky remains basically unchanged:

ab overlay
Lab channels overlay (click to see the image after the saturation adjustment).

I’m now almost satisfied with the result, except for one thing: the Lab overlay makes the yellow area on the left of the image way too bright. The solution is a gradient mask (horizontal this time) associated to the “ab overlay group”, to exclude the left part of the image as shown below:

overlay blend mask

The final, masked image is shown here, to be compared with the initial starting point:

final result
The image after the masked Lab overlay blend (click to see the initial +1EV version).

The Final Touch

Through the tutorial I have intentionally pushed the editing quite above what I would personally find acceptable. The idea was to show how far one can go with the techniques I have described; fortunatey, the non-destructive editing allows us to go back on our steps and reduce the strength of the various effects until the result looks really ok.

In this specific case, I have lowered the opacity of the “contrast” layer to 90%, the one of the “saturation” layer to 80% and the one of the “ab overlay” group to 40%. Then, feeling that the “b channel” blend was still brightening the yellow areas too much, I have reduced the opacity of the “b channel” layer to 70%.

opacity adjustment
Opacities adjusted for a “softer” edit (click on the image to see the previous version).

Another thing I still did not like in the image was the overall color balance: the grass in the foreground looked a bit too “emerald” instead of “yellowish green”, therefore I thought that the image could profit of a general warming up of the colors. For that I have added a curves layer at the top of the editing stack, and brought down the middle of the curve in both the green and blue channels. The move needs to be quite subtle: I brought the middle point down from 50% to 47% in the greens and 45% in the blues, and then I further reduced the opacity of the adjustment to 50%. Here comes the warmed-up version, compared with the image before:

opacity adjustment
“Warmer” version (click to see the previous version)

At this point I was almost satisfied. However, I still found that the green stuff at the bottom-right of the image attracted too much my attention and distracted the eye. Therefore I darkened the bottom of the image with a slightly curved gradient applied in “soft light” blend mode. The gradient was created with the same technique used for blending the various exposures. The transition curve is shown below: in this case, the top part was set to 50% gray (remember that we blend the gradient in “soft light” mode) and the bottom part was moved a bit below 50% to obtain a slightly darkening effect:

vignetting gradient
Gradient used for darkening the bottom of the image.

It’s done! If you managed to follow me ‘till the end, you are now rewarded with the final image in all its glory, that you can again compare with the initial starting point.

final result
The final image (click to see the initial +1EV version).

It has been a quite long journey to arrive here… and I hope not to have lost too many followers on the way!

Basic Landscape Exposure Blending with GIMP and G'MIC


Basic Landscape Exposure Blending with GIMP and G'MIC

Exploring exposure blending entirely in GIMP

Photographer Ian Hex had previously explored the topic of exposure blending with us by using luminosity masks in darktable. For his first video tutorial he’s revisiting the subject entirely in GIMP and G’MIC.

Have a look and let him know what you think in the forum. He’s promised more if he gets a good response from people - so let’s give him some encouragement!

Interesting Usertest and Incoming


Interesting Usertest and Incoming

A view of someone using the site and contributing

I ran across a neat website the other day for getting actual user feedback when viewing your website: UserTesting. They have a free option called peek that records a short (~5 min.) screencast of a user visiting the site and narrating their impressions.

Peek Logo

You can imagine this to be quite interesting to someone building a site.

It appears the service asks its testers to answer three specific questions (I am assuming this is for the free service mainly):

  • What is your first impression of this web page? What is this page for?
  • What is the first thing you would like to do on this page? Please go ahead and try to do that now. Please describe your experience.
  • What stood out to you on this website? What, if anything, frustrated you about this site? Please summarize your thoughts regarding this website.

Here’s the actual video they sent me (can also be found on their website):

I don’t have much to say about the testing. It was very insightful and helpful to hear someones view coming to the site fresh. I’m glad that my focus on simplicity is appreciated!

It was interesting that the navigation drawer wasn’t used, or found, until the very end of the session. It was also interesting to hear the testers thoughts around scrolling down the main page (is it so rare these days for content to be longer than a single screen - above the fold?).

Exposure Blended Panorama Coming Soon

The creator of new processing project PhotoFlow, Andrea Ferrero, is being kind enough to take a break from coding to write a new tutorial for us: “Exposure Blended Panoramas with Hugin and Photoflow”!

I’ve been collaborating with him on getting things in order to publish and this looks like it’s going to be a fun tutorial!

Submitting

We’ve been talking back and forth trying to find a good workflow for contributors to be able to provide submissions as easily as possible. At the moment I translate any submissions into Markdown/HTML as needed from whatever source the author decides to throw at me. This is less than ideal (but at least it’s nice and easy for authors - which is more important to me than having to port them manually).

Github Submissions

For those comfortable with Git and Github I have created a neat option to submit posts. You can fork my PIXLS.US repository from here:

https://github.com/patdavid/PIXLSUS

Just follow the instructions on that page, and issue a pull request when you’re done. Simple! :) You may want to communicate with me to let me know the status of the submission, in case you’re still working on it, or it’s ready to be published.

Any Old Files

Of course, if you want to submit some content, please don’t feel you have to use Github if you’re not comfortable with it. Feel free to write it any way that works best for you (as I said, my native build files are usually simple Markdown). You can also reach out to me and let me know what you may be thinking ahead of time, as I might be able to help out.

A New (Old) Tutorial


A New (Old) Tutorial

Revisiting an Open Source Portrait (Mairi)

A little while back I had attempted to document a shoot with my friend and model, Mairi. In particular I wanted to capture a start-to-finish workflow for processing a portrait using free software. There are often many tutorials for individual portions of a retouching process but rarely do they get seen in the context of a full workflow.

The results became a two-part post on my blog. For posterity (as well as for those who may have missed it the first time around) I am republishing the second part of the tutorial Postprocessing here.

Though the post was originally published in 2013 the process it describes is still quite current (and mostly still my same personal workflow). This tutorial covers the retouching in post while the original article about setting up and conducting the shoot is still over on my personal blog.

Mairi Portrait Final
The finished result from the tutorial.
by Pat David (cba).

The tutorial may read a little long but the process is relatively quick once it’s been done a few times. Hopefully it proves to be helpful to others as a workflow to use or tweak for their own process!

Coming Soon

I am still working on getting some sample shots to demonstrate the previously mentioned noise free shadows idea using dual exposures. I just need to find some sample shots that will be instructive while still at least being something nice to look at…

Also, another guest post is coming down the pipes from the creator of PhotoFlow, Andrea Ferrero! He’ll be talking about creating blended panorama images using Hugin and PhotoFlow. Judging by the results on his sample image, this will be a fun tutorial to look out for!

An Open Source Portrait (Mairi)


An Open Source Portrait (Mairi)

Processing a portrait session

This is an article I had written long ago (originally published in 2013). The material is still quite relevant and the workflow hasn’t really changed, so I am republishing it here for posterity and those that may have missed it the first time around.

The previous post for this article went over the shoot that led to this image.

If you’d like to follow along with the image of Mairi, you can download the files from the links below.

Download the .ORF RAW file [Google Drive]
Download the full resolution .JPG output from RawTherapee.
Download the Full Resolution .XCF file [.7zip - 265MB]
If you want to use the .XCF file just to see what I did, I recommend the ½ resolution file, as it’s smaller: Download the ½ Resolution .XCF file [.7zip - 60MB]
These files are being made available under a Creative Commons Attribution, Non-Commercial, Share Alike license (CC-BY-SA-NC).

To whet your appetite, here is the final result of all of the postprocessing done in this tutorial (click to compare it to no retouching):

Mairi Final Result
The final result I’m aiming for.
Click to compare to original.

Picking Your Image

This is a hard thing to quantify, as each of us is driven by our own vision and style. In my case, I wanted something a little more somber looking with a focus on her eyes (they are the window to the soul, right?). There’s just something I like about big, bright eyes in a portrait, particularly in women.

I also personally liked the grey sweater against the grey background as well. I felt that it put more focus on the colors of her skin, hair, and eyes. So that pretty much narrowed me down to this contact sheet:

Mairi contact sheet
Narrowing it down to this set.

Looking over the shots, I decided I liked the images with the hood up, but her hair down and flowing around her. This puts me in the top two rows, with only a few left to decide upon. At this point I narrowed it down to one that I liked best - grey sweater, hood up but not pulled back against her head, hair flowing out of it, and big eyes.

This is pretty common, I’d imagine. You can grab several frames, but in the end hopefully just the right amount of small details will come together and you’ll find something that you really like. In my case it was this one:

Mairi Raw
I finally decided on this shot based on the color, hair, eyes, and slight smile.

Now hold on a minute. The image above is the JPG straight out of the camera. As you can see, I’ve underexposed this one a little bit, and the colors are not anywhere near where I’d like them to be. If you’re following along don’t download this version of the image. I’ll have a much better starting JPG after we run it through some RAW development first!

If you’re impatient, jump to that section and get the image there.

Raw Processing

There are a few RAW conversion options out there in the land of F/OSS. Here’s a small list of popular ones to peruse:

One of the reasons I love using F/OSS is the availability (usually) of the software across my OS’s. In my case I went with RawTherapee a while back and liked it, so I’ve stuck with it so far (even though I had to build my own OSX versions).

So, my workflow includes RawTherapee at this point. You should be able to follow along in other converters, but I’m going to focus on RT because that’s what I’m using. If you shoot only in JPG (seriously, use RAW if you can), you can skip this section and head directly down to GIMP Retouching.

Load it up

After starting up RawTherapee, you’ll be in the File Browser interface, waiting for you to select a folder of images. You can navigate to your folder of images through the file browser on the left side of the window. It may take a bit while RawTherapee generates thumbnails of all the images in your directory.

RawTherapee File Browser
RawTherapee file browser view.
(Navigate folders on the left pane)

Once you’ve located your image, double clicking it in the main window will open it up for editing. If you’re using a default install/options on RT, chances are a “Default” profile will be applied to your image that has Auto Levels turned on.

Mairi RawTherapee Default
The base image with “Default” profile applied (auto levels).

Chances are that Auto Levels will not look very good. My Default processing profile usually does not look so hot (no noise reduction, auto levels, etc.). That’s ok, because we are going to fix this right up in the next few sections.

Adjust Exposure

I like to control the exposure and processing on my RAW images. Auto Levels may work for some, but once you get used to some basic corrections and how to use them it’s relatively quick and painless to dial-in something you like quickly.

Again - much of what I’m going to describe is subjective, and will depend on personal taste and vision. This just happens to be how I work, adjust as needed for you own workflow. :)

To give me a good starting point I will usually remove all adjustments to the image, and reset everything back to zero. This is easy to do as my Default profile has nothing done to it other than Auto Levels.

RawTherapee Default Exposure Values
Auto Levels values on the Exposure panel.

A quick and easy way to reset the Exposure values on the Exposure panel is to use the Neutral button on that panel (I’ve outlined it in green above). You can also hit the small “undo” arrows next to each slider to set that slider back to zero as well.

At this point the image exposure is set to a baseline we can begin working on. For reference, here is my image after zeroing out all of the exposure sliders and the saturation:

Mairi RawTherapee Zero Values
With all exposure adjustments (and saturation) set to zero.

Exposure Compensation

The first thing I’ll begin adjusting is the Exposure Compensation for the image. You want to be paying careful attention to the histogram for the image to know what your adjustments to Exposure Compensation are doing, and to keep from blowing things out.

I personally begin pushing the Exposure Compensation until one of the RGB channels just begins butting up against the right side of the histogram. Here is what the histogram looks like for the neutral exposure:

RawTherapee Neutral Histogram
Neutral exposure histogram.

After adjusting Exposure Compensation I get the Red channel snug up against the right side of the histogram:

RawTherapee Histogram Exposure Compensation
Exposure Compensation until the values just touch the right side.

If you go a little too far, you’ll notice one of the channels will spike against the side, and if you really go too far, you’ll get a small colored box in the upper right corner indicating that channel has gone out of range (is blown out).

So here is what my image looks like now with only the Exposure Compensation adjusted to a better range:

Mairi RawTherapee Exposure Compensation
Exposure Compensation adjusted to 2.40.

The Exposure panel in RT now looks like this (only the Exposure Compensation has been adjusted):

RawTherapee Exposure Compensation Panel
Exposure Compensation set to 2.40 for this image.

If the highlights in your image begin to get slightly out of range, you may need to make adjustments to the Highlight recovery amount/threshold, but in my case the image was slightly under-exposed, so I kept it zero.

There is also a great visual method of seeing where your exposures for each channel are at, and to avoid hightlight/shadow clipping. Along the top of your main image window, to the right, there are some icons that look like this:

RawTherapee Clipping Channels
Channel previews, Highlight & Shadow clipping indicators

The Channel previews let’s you individually toggle each of the R,G,B, and Luminosity previews for the image. You can use these with the Highlight and Shadow clipping indicators to see which channels are clipping and where.

Highlight and Shadow clipping indicators will visually show you on your image where the values go beyond the threshold for each. For highlights, it’s any values that are greater than 253, and for shadows it’s any values that are lower than 8.

To illustrate, here is what my image looks like in RT with the Exposure Compensation set to 2.40 from above:

Mairi RawTherapee Clipping Channels
With Highlight & Shadow clipping turned on.

I don’t mind the shadows clipping in the dark regions of the image, though I can make adjustments to the Black Point (below) to modify that. The highlight clipping on her face is of more concern to me. I certainly don’t want that!

At this point I can dial in my Exposure Compensation for the highlights by backing it down slightly. As I ease off it I should be seeing the dark patch for Highlight Clipping growing smaller. I’ll stop when it’s either all gone, or just about all gone.

I wasn’t too far off in my initial adjustment, and only had to back the Exposure Compensation off to 2.30 to remove most of the highlight clipping.

Settings so far (everything else zero)…

Exposure Compensation 2.30

Black Point

At this point I will usually zoom a bit into a shadow area of my image that might include dark/black tones. The blacks feel a little flat to me, and I’m going to increase the black level just a bit to darken them up.

I want to be zoomed in a bit so I can determine at which point the black point crushes any details that I want to be visible still. You want your blacks to be dark if possible, but you want to keep details in the shadows if possible (it’s really, really subjective where this point is, but I’ll err on the conservative side since I am still going to process colors a little bit in GIMP later).

Starting with a Black point of zero:

Mairi Detail Black 0

I will increase the Black point while keeping an eye on those shadow details, increasing it until I like how the blacks look and I haven’t destroyed detail in the dark tones. I finally settled on a Black value of 150 as seen here:

Mairi Detail Black 150
Black value set at 150 (still keeping sweater details in the shadows).
Click to compare to previous.

Watch out for Shadow Recovery when you first start adjusting the Black Point. It’s default might be a different value than zero (mine is at 50), and the Neutral button won’t set it back to zero (resetting it will give it back to it’s default value of 50). You may want to push it manually to zero, and if you feel you want to bump shadow details a bit, then start pushing it up.

I know things look noisy at the moment, but we’ll deal with that in the next section (there is no noise reduction being applied at this point).

Settings so far (everything else zero)…

Exposure Compensation 2.30
Black 150

Brightness, Contrast, and Saturation

For this image I didn’t feel the need to modify these values, but this is purely subjective (again). If you do modify these values, keep an eye on the histogram and what it’s doing to keep things from getting out of range/whack again.

White Balance

Hopefully you had the right White Balance set during your shoot in camera. If not, it’s ok - we’re shooting in RAW so we can just set it as needed now.

I happen to have had my in-camera WB set to Flash, so the embedded WB settings in my RAW file metadata are pretty close. In my shot, however, you’ll notice that there is a bit of a white window visible in the left of the frame. I happen to know that the window is quite white, and should be rendered as such in my image.

As a side note, what I really should have done was to get myself a good reference for balancing the white balance, and to shoot it as part of my setup. Something like the X-Rite MSCCC ColorChecker Classic, or even a WhiBal G7 Certified Neutral White Balance Card. These are a little pricey, but any good 18% grey card will do, really. I just happen to know that my window borders are a pure white, so I’m cheating a bit here…

So here is what our image looks like at the moment:

Mairi White Balance Camera
Image so far, with White Balance set to Camera (Default).

The White Balance for your image can be adjusted from the Color panel:

RawTherapee Default Color
Default Color panel showing Camera white balance.

You can try out some of the presets in the Method drop-down - there are the typical settings there for Sunny, Shade, Flashes, etc… In my case I am going to use the Spot WB option. Clicking that button will let me pick a section of my image that should be color neutral.

In my case, I know that the window border should be white (and color neutral), so I will pick from that area on my image. Doing so will shift my WB, and will produce a result that looks like this:

Mairi Camera White Balance
WB based on white window border.
Click to compare Camera based

I also happen to know that the grey colored walls in the background are close to neutral, but with the slightest hint of blue in them. If I used the grey wall instead of the white window, I would introduce the slightest warm cast to the image. I tried it (choosing a section of the grey wall on the right side of the background), and actually prefer the slightly warmer color, personally:

Mairi White Balance Wall
WB based on the grey wall background (right side of image).
Click to compare to window WB.

The difference is ever so slight, but it is there. In my original final image, I went with the balance pulled from the wall, so I will continue with that version here. If you’re curious, here is what my WB values look like:

RawTherapee Spot White Balance Window
After setting Spot WB to the window.

Seriously, though, don’t rely on luck. Get a grey/color card to correct color casts if you can…

Settings so far (everything else zero)…

Exposure Compensation 2.30
Black 150
WB Temperature 7300
WB Tint 0.545

Noise Reduction & Sharpening

Chances are the RAW image is going to look pretty noisy zoomed in a bit. This isn’t unusual since we are dealing with RAW data. There are two noise reduction (NR) options in RT, and we are going to want to use both.

Impulse Noise Reduction

This NR will remove pixels that have a high impulse deviation from surrounding pixels. Basically the “salt and pepper” noise you may notice in your images where individual pixels are oddly brighter/darker than the surrounding pixels.

If I zoom into a portion of my image (not far from where I was looking at shadows for setting a black point), I’ll see this:

Noise Reduction Crop None
Closeup crop with no Impulse Noise Reduction.

I’ll normally play a bit with the Impulse NR to alleviate the specks while still retaining details. As with most NR methods - going a bit too far will obliterate some details with the noise. The trick is to find a happy medium between the two. In my case, I settled on a value of 55 (the default is 50):

Impulse Noise Reduction 55
Impulse NR set to a value of 55.
Click to compare to no NR.

I could have gone a bit further (and have in others from this series), and pushed it up to the 60-70 range, but it’s a matter of taste and weighing the tradeoffs.

Luminance/Chrominance Noise Reduction

These two NR methods will suppress noise in the luminance channel (brightness), and the blue/red chrominances.

I will use a light hand with these NR values. The defaults are 5 for each, and it should make a noticeable difference just with the default values. If you push the Luminance NR too far, you’ll smear fine details right off your image. If you push the Chrominance NR too far, you’ll suck the life out of the colors in your image.

Not surprisingly, it’s another trade off. In my case, I pushed the L/C NR just a tiny bit past the default to 6 and 6 respectively.

You’ll be able to see the effect of chrominance NR by looking at the flat colored grey wall in the background. Just don’t forget to check other areas of your image with the settings you choose. For me it was a close look at her iris, where pushing the chrominance NR too far lost some of the beautiful colors in her eye.

Compare the same crop from above with and without Luminance/Chrominance noise reduction applied:

Noise Reduction Luminance Chrominance 6 6
With Luminance & Chrominance NR set to 6.
Click to compare without.

If you’ve read my previous article on B&W conversion, you’ll know that I don’t mind a little noise/grain in my images at all, so this level doesn’t bother me in the least. I could chase the noise even further if I really wanted to, but always remember that doing so is going to be at the expense of detail/color in your final result. As with most things in life, moderation is key!

Sharpening

If you are going to sharpen your image a bit, this is probably the best time to do so. The problem is that usually sharpening is the last bit of post-processing you should do to your image, due to it’s destructive nature. Plus, lately I’ve grown accustomed to sharpening by using an extra wavelet scale during my skin retouching in GIMP (you’ll see below in a bit).

So, I’ll avoid sharpening at this stage. If I was going to use it here at all, it would be just very, very light. Also, if you do any sharpening at this stage, try to make sure that it happens after any noise reduction in the pipeline.

Settings so far (everything else zero)…

Exposure Compensation 2.30
Black 150
WB Temperature 7300
WB Tint 0.545
Impulse NR 55
Luminance NR 6
Chrominance NR 6

Lens Correction

This is actually a section that deserves its own post, detailing methods for correcting for lens barrel distortion with Hugin. RawTherapee actually has an “Automatic Distortion Correction” that will effect pincushion distortion in your images.

In my case, I was shooting at the long end of the lens at 50mm, and the distortion is minimal. So I didn’t bother with correcting this (it might have been needed at a shorter focal length, and being closer to the subject, though).

In Summary

That about wraps up the RAW “development” I’m going to do on this image. I try to keep things minimal where possible, though I could have gone further and adjusted color tones and LAB adjustments here as well. In fact, with the exception of Wavelet Decompose for skin retouching, and some other masking/painting operations, I could do most of what I want for this portrait entirely in RawTherapee.

I know that this reads really long, but the truth is that once I am accustomed to a workflow, this takes less than 5 minutes from start to finish (faster if I’ve already fiddled with other images from the same set). All I really modified here was Exposure, White Balance, and Noise Reduction.

Finally, as I hinted at earlier, here is the final version after doing all of these RAW edits, as we get ready to bring the image into GIMP for further processing:

Mairi Final Version from RawTherapee
This is the one to download if you want to follow along in GIMP below.
Just click the image to open in a new window, then save it from there.

GIMP Retouching

Well, here we are. Finally. It’s the home stretch now, so don’t give up just yet!

If you didn’t follow along with the RAW processing earlier, you can download the full resolution JPG output from RawTherapee by clicking here:

Download the full resolution JPG output from RawTherapee

Armed with our final results from RawTherapee, we’re now ready to do a little retouching to the image.

The overall workflow and the order in which I approach them is dependent on my mood mostly. Most times, I enjoy doing skin retouching, so I’ll often jump right in with Wavelet Decompose and play around. Really, though, I should start shifting Wavelet Decompose to a later part of my workflow, and fix other things like removing objects from the background and fixing flyaway hairs first.

This way, I can directly re-use wavelet scales for a slight wavelet sharpening while I have them.

Looking at this image so far, I can spot a few broad things that I want to correct, and I’m going to address them in this order:

  1. Touchup flyaway hairs
  2. Crop & remove distracting background elements
  3. Skin retouching with Wavelet Decompose
  4. Contour paint highlights
  5. Apply some color curves

Touchup Flyaway Hairs

If you can have the model bring a hairbrush with them to a shoot - DO IT. Seriously. Your eyes and carpal tunnel will thank me later.

Even with a brush or hairstylist/make-up artist the occasional hair will decide to rebel and do its own thing. This will require us to get down to the details and fix those hairs up.

Luckily for me, Mairis hair mostly cooperated with us during the shoot (and where it didn’t I kind of liked it). To illustrate this step, though, I’m going to clean up some of the stray hairs on the left side of the image (the right side of her face).

Luckily for me, the background is a consistent color/texture. This means cloning out these hairs shouldn’t be too much of a problem, but there are still some things you should keep in mind while doing this.

Here is the area that I’d like to clean up a little bit:

Mairi Hair Left Original
Sometimes you just have to work one strand of hair at a time…
GIMP Clone Tool Hair

I will usually use a hard-edged brush because a soft-edge will smear details on its edges, and can often be spotted pretty easily by the eye. This works because the background is relatively constant in grain and color.

I’ll sample from an area near the hair I want to remove, and set the brush to be “Aligned”. I also try to keep the brush size as small as I can and still remove the hair.

The thing to keep in mind is how the hair is actually flowing, and to follow that. I will often follow outlying strands of hair back to where they start from the head, and begin cloning them out from there.

I also try not to get too ambitious (some stray hairs are sometimes fine). Removing too many at once can lead to unrealistic results, so I try to be conservative, and to constantly zoom out and check my work visually.

Try not to leave hairs prematurely cut off in space if possible, it tends to look a bit distracting. If you want to remove a hair that crosses over another strand that you may want to keep, make sure to adjust the source of the clone brush so you can do it without leaving a gap in the leftover strand.

Here is a quick 5 minute touchup of some of the stray hairs (click to compare to the original):

GIMP Hair Clean Clone
Click to compare.

Occasionally, you’ll need to fix hairs that are crossing over other hair (sort of like a virtual “brushing” of the hair). In these cases, you really have to pay careful attention to how the hair flows and to use that as a guide when choosing a sample point with either the clone or heal brush.

If this sounds like a lot of work - it is. Thankfully, once you’ve become accustomed to doing it, and doing it well, you’ll find yourself picking up a lot of speed. It’s one of those things that’s worth learning to do right, and to let practice speed it up for you.

I actually like the cascading hair around her face opening up to a pretty color, so that’s about as far as I’m going to go with stray hairs on this image.

Fixing the Background & Cropping

With the limited space I had to shoot this portrait, it’s no surprise that I had gotten some undesirable background elements, like the window edges.

There’s a couple of ways I could go about fixing these - I could fix the background in place, or I can crop out the elements I don’t want.

In my final version shown in the previous post, I wanted to crop tighter, so it worked out well to remove the window on the left. To illustrate how we can remove the window, I’m going to leave the aspect ratio as it is, and walk through removing the distracting background elements.

Removing Background Elements

Because most of the background is already a (relatively) solid color, this isn’t too hard. There’s just a couple of simple things to keep in mind.

The way I’m going to approach this is to make a duplicate of my current layer, and to move the duplicate into place such that the background will cover up parts of the window I want to remove. Then I’ll mask the duplicate layer to hide the window.

I start by choosing an area of the background that’s similar in color/tone:

GIMP Mairi Background Fix Start
Thankfully the background is relatively consistent.

I’ll then move the duplicate layer so that the green area covers up the window to the left:

GIMP Mairi Background Fix End
Position the duplicate layer so the green area now covers up the window.

Here is what this looks like in GIMP, with the duplicate layer set to 90% opacity over the base layer (so you can see where the window edge is):

GIMP Mairi Background Shift
Moving the duplicate layer over to cover the window.

Now I’ll add a black (fully transparent) layer mask over the duplicate layer, and I’ll paint white on the mask to cover up the window edge (with a soft-edged brush). This give me results that look like this:

Mairi GIMP background shift masked
After applying a transparent mask, and painting white over the window edge.

The problem is that the background area from the duplicate is a bit darker than the base layer background, and the seam is visible where they are masked. To fix this, I can just adjust the lightness of the duplicate layer until I get a good match.

I used Hue-Saturation to adjust the lightness (because I wasn’t sure if I would need to adjust the hue slightly as well - turns out I didn’t). I found that increasing the Lightness value to 3 got me reasonably close:

GIMP Mairi Background lightened
After increasing duplicate layer Lightness to 3.

To further fix the lower part of the window, I just repeated all the steps above with another duplicate of the base layer, just shifted to cover the lower part of the window. I had to mask along her sweater. Here is the result after repeating the above steps:

GIMP Mairi background masked finished
After repeating above steps for the lower left corner.

The results are ok, but could be just a little bit better. Visually, the falloff of light on the background doesn’t match what’s happening on her body, so I added a small gradient to the lower left corner to give it a more natural looking light falloff:

GIMP Mairi background masked gradient
Adding a gradient to the lower left background helps it look more natural.

Fixing the slight window/shadow on the right is easily done with a clone/heal tool combination. The final result of quickly cleaning up the background is this:

GIMP Mairi background final fix
Finished cleaning up the background.

I could have spent a little more with this, but I’m happy with the results for the purpose of this post. If your cloning efforts leave obvious transitions between tones, the Heal tool can be helpful for alleviating this (especially when used with large brush radii, just be prepared to wait a bit).

With the background squared away, we can move on to one of my favorite things to play with, skin retouching!

Skin Retouching with Wavelet Decompose

I had previously written about using Wavelet Decompose as a means for touching up skin. As I said in that post, and will repeat here:

The best way to utilize this tool is with a light touch.

Re-read that sentence and keep it in mind as we move forward.

Don’t make mannequins.

Ok, with a layer that contains all of the changes we’ve made so far rolled up, we can now decompose the image to wavelet scales. In my case I almost always use the default of 5 scales unless there’s a good reason to increase/decrease that number.

For anyone new to this method, the basic idea of Wavelet Decompose is that it will break down your images to multiple layers, each containing a specific set of details based on their relative size, and a residual layer with color/tonal information. For instance, Wavelet scale 1 will contain only the finest details in your image, while each successive scale will contain larger and larger details.

The benefit to us is that these details are isolated on each layer, meaning we can modify details on one layer without affecting other details from other layers (or adjust the colors/tones on the residual layer without modifying the details).

Here is an example of the resulting layers we get when running Wavelet Decompose:

GIMP Wavelet Separation Example
Wavelet scales from 1 (finest) to the Residual

After running Wavelet Decompose, we’ll find ourselves with 6 new layers: Residual + 5 Wavelet scales. I am going to start on Wavelet scale 5.

If you hold down Shift and click on a layer visibility icon, you’ll isolate just that single layer as visible. Do this now to Wavelet scale 5, and let’s have a look at what we’re dealing with.

I usually work on skin retouching in sections. Usually I’ll consider the forehead, nose, cheeks to smile lines, chin, and upper lip all as separate sections (trying to follow normal facial contours). Something like this:

GIMP Wavelet Decompose Region Breakdown
Rough breakdown of each area I’ll work on separately

I’m going to start with the forehead. I’ll work with detail scales first, and follow up with touchups on the residual scale if needed to even out color tones. Here is what Wavelet scale 5 looks like isolated:

GIMP Wavelet Scale 5 forehead
Forehead, Wavelet scale 5

It may not seem obvious, especially if you don’t use wavelet scales much, but there’s a lot of large scale tonal imperfections here. Look at the same image, but with the levels normalized:

GIMP Wavelet Scale 5 forehead
These are the tones we want to smooth out

Normalizing the wavelet scale lets you see the tones that we want to smooth out.

My normal workflow is to have all of the wavelet scales and residual visible (each of the wavelet scales has a layer blending mode of Grain Merge). This way I’m visually seeing the overall image results. Then I will select each wavelet scale as I work on it.

I’ll normally use the Free Select Tool to select the forehead. I’ll usually have the Feather edges option turned on, with a large radius (maybe 1% of the smallest image dimensions roughly - so ~35 pixels here). Remember to have your layer selected that you want to work on.

With my area selected, I’ll often run a Gaussian Blur (IIR) over the skin to smooth out those imperfections. The radius you use is dependent on how strong you want to smooth the tones out. Too much, and you’ll obliterate the details on that scale, so start small.

Here is my selection I’ll work with (remember - my active layer is Wavelet scale 5):

GIMP Wavelet Scale selection
Forehead with selection (feather turned on to 35px)

Now I’ll experiment with different Gaussian Blur radii to get a feel for how it will effect my entire image. I settled on a high-ish value of 35px radius, which gave me this as a result (click to compare to original):

GIMP Wavelet Scale selection
Forehead, Wavelet scale 5 after Gaussian Blur (IIR) 35px radius.
Click to compare.

Just with this small change to a single wavelet scale, we can already see a remarkable improvement to the underlying skin tones, and we haven’t hurt any of the fine details in the skin!

In some cases, this may be all that is required for a particular area of skin. I could push things just a tiny bit further if I wanted by working globally again on a finer wavelet scale, but I’ve learned the hard way to back off early if possible.

Instead, I’ll look at specific areas of the skin that I may want to touch up. For instance, the two frown lines in the center of the forehead. I may not want to remove them completely, but I may want to downplay how visible they are. Wavelet scales are perfect for this.

GIMP Wavelet Scale selection
Small frown lines I want to reduce

Because each of the Wavelet scales are set to a layer blend mode of Grain Merge, this means that any area that has a completely grey color will not effect the final image. This means that you can paint with medium grey RGB(128,128,128) to completely remove a detail from a layer.

You can also use the Blur/Sharpen brush to selectively blur an area of the image as well. (I’ve found that the Blur tool works best at smaller wavelet scales - it doesn’t appear to make a big difference on larger scales).

So, if we look at Wavelet scale 5 where the frown lines are, we’ll see there’s not much there - it was already smoothed earlier. If we look at Wavelet scale 4 though, we’ll see them prominently.

I’ll use the Heal Tool to sample from the same wavelet scale in a different location, and paint over just the frown lines. I’ll work on Wavelet scale 4 first. If needed, I can also move down to Wavelet scale 3 and repeat the same procedure there.

A couple of quick passes just over the frown lines, and the results look like this:

GIMP Wavelet Scale selection
Cloning over frown line on scale 4 & 3.
Click to compare.

I could continue over any other blemishes I may want to correct, but small individual blemishes can usually be fixed with a little spot healing quickly.

Moving on to the nose, the tones have different requirements. Overall, the tones on Wavelet scale 5 are similar to the forehead. In this case, a similar amount of blurring as the forehead on scale 5 will nicely smooth out the tones. Here is the nose after a slight blurring (click to see original):

GIMP mairi wavelet decompose nose
Nose with 35px Gaussian blur on Wavelet scale 5.
Click to compare.

There is a bit of color in the nose that is slightly uneven that I’d like to fix. This is relatively easy to do with wavelet scales, because I can modify the underlying color tones of the nose without destroying the details on the other scale layers.

In this case, I’ll work on the Wavelet residual layer.

I’ll use a Heal Tool with a large, soft brush. I’ll sample from about the middle of the nose, and clean up the slightly redder skin by healing new tones into that area. I’ll follow the contours of the nose and the way that the light is hitting it in order to match the underlying tones to what is already there.

After a little work these are the results (click to compare to original):

GIMP Wavelet Scale selection nose
Healing on the Wavelet residual scale to even tones.
Click to compare.

Next I’ll take a look at the eyes and cheek on the brighter side of her face.

GIMP Mairi wavelet decompose cheek original
Overall tones are good here, just some slight retouching required

The tones here are not bad, particularly on scale 5. After making my selection, I’ve applied a blur at 25px just to smooth things a bit.

GIMP Mairi wavelet decompose cheek
A slight 25px blur to smooth overall tones.
Click to compare.

The dark tones under/around the eyes is a bit different to deal with. As before, I’ll turn to working on the Wavelet residual layer to brighten up the color tones under the eyes.

I use the Heal Tool to sample from a brighter area of skin near the eye. Then I’ll carefully paint into the dark tones to brighten them up, and to even the colors out with the surrounding skin.

GIMP Mairi wavelet residual eyes
Carefully cloning/healing brighter skin tones under the eyes.
Click to compare to original.

Wavelets are amazing for this type of adjustment, because I can brighten up/change the skin tones under the eyes without effecting the fine skin details here like small wrinkles and pores. The textual character remains unchanged, but the underlying skin tones can be modified easily.

The same can be done for the slightly red tones on the cheek, and at the edge of her jaw. Which I did.

I’m purposefully not going to modify the fine wrinkles under the eyes, either. These small imperfections will often bring great character to a face, and unless they are very distracting or bad, I find it best to leave them be.

A good tip is that even though these small imperfections may seem large when you’re pixel peeping, get into the habit of zooming out to a sane zoom level and evaluate the image then. Sometimes you’ll find you’ve gone too far, and things begin to creep into mannequin territory.

Don’t make mannequins!

In Summary Again

This entire post is getting a little long, so I’m going to stop here with the skin retouching breakdown.

Also, that’s honestly about it as far as the process goes. Just repeat on the areas that are left (right cheek, chin, and upper lip). You can just apply the processes I described above to those other areas, in the same way.

To summarize, here are the tools/steps I’ll use with Wavelet Decompose to retouch skin:

  • Area selection with Gaussian blur to even out overall tones at a particular scale
  • Paint with grey, Clone, Heal on wavelet scales to modify specific details
  • Clone/Heal on wavelet residual scale to modify underlying skin tones/colors (but leave details intact)

Here are the final results after using only Wavelet Decompose (click to compare to original):

Mairi GIMP Wavelet face final retouching
After retouching in Wavelet Scales only.
Click to compare to original.

Spot Touchups

There may be a few things that still need a little spot touchup that I didn’t bother to mess with in Wavelet scales.

In my case, I’ll clone/heal out some small hairs along the jaw line, and touch up some small spots of skin individually. This is really just a light cleaning, and I usually do this at the pixel level (obnoxiously zoomed in, and small brush sizes).

I also use a method for checking the skin for areas that I may want to touchup, but might not be immediately visible or noticeable. It uses the fact that the Blue channel of an image can show you just how scary skin can look (seriously, color decompose any image of skin, and look at the blue channel).

Contour Painting Highlights

One of the downsides of using Wavelet scales for modifying skin is that if you’re blurring on some of the scales, you’ll sometimes decrease the local contrast in your image. This isn’t so bad, but you may want to bring back some of the contrast in areas you’ve touched up.

What I’m going to do is basically add some transparent layers over my image, and set their layer blend modes to “Overlay”.

Then I’ll paint white over contours I want to enhance, and adjust the opacity of the layer to taste. (This is highly subjective, so I’m going to just show a quick idea of how I might approach it - you can get as nuts with this as you like…).

Here I’ve added a new transparent layer on top of my image, and set the Layer Blend Mode to Overlay. Then I painted white onto contours that I want to highlight:

Mairi GIMP Contour dodge burn highlight
Painting on the Overlay layer along contours to highlight

It looks strange right now, but I’ll add a large radius Gaussian Blur to smooth these tones out. I used a blur radius of 111 pixels. Here is what it looks like after the blur:

Mairi GIMP Contour dodge burn highlight gaussian blur
Blurring the Overlay layer with Gaussian Blur (111 pixel radius)

Finally, I’ll adjust the opacity of the Overlay layer to taste. I’ll usually dial this way, way down so that it’s not so obvious. Here, I’ve dialed the opacity back to about 20%, which leaves us with this (click to compare):

Mairi GIMP Contour dodge burn highlight final One
After setting the Overlay layer to 20% opacity (still a little high for me, but it’s good for illustration).
Click to compare.

I will sometimes add a few more of these layers to enhance other parts of the image as well. I’ll use it (very lightly!!!) to enhance the eyes a bit, and in this case, I used an even larger layer to add some volume and highlights to her hair as well.

Here is the results after adding some eye and hair highlight layers as well (click to compare no highlights):

mairi gimp contour dodge burn final
Face, eyes, and hair contour painting result.
Click to compare.

Color Curves

Finally, I like to apply some color curves that I have around and use often. I’ve been heavily favoring a Portra emulation curve from Petteri Sulonen that he calls Portra-esque, especially for skin. It has a very pretty rolloff in the highlights that really renders pretty colors.

If I feel it’s too much, I can always apply it on a duplicate of my image so far, and adjust opacity to suit. Here is the same image with only the Potra-esque curve applied:

mairi gimp color tone curve portra
Image so far, with a Portra-esque color curve applied.
Click to compare.

If you’re curious, I had written up a much more in-depth look at color curves for skin here: Getting Around in GIMP - More Color Curves (Skin). You can actually download the curves for Portra, Velvia, Provia emulation on that page.

Final Sharpening

Finally. The last step before saving out our image!

For sharpening, I actually like to use one of the Wavelet scales that I generated earlier. I’ll just duplicate a low scale, like 2 or 3, and drag it on top of my layer stack to sharpen the details from that scale.

In this case, I liked the details from Wavelet scale 2, so I duplicated that layer, and dragged it on top of my layer stack. The blend mode is already set to Grain Merge, so I don’t have to do anything else:

mairi gimp sharpen wavelet scale
Wavelet scale 2 copied to the top of the layer stack for sharpening.
Click to compare.

Finally at the End

If you’re still with me - you really deserve a medal. I’m sorry this has run as long as it has, but I wanted to try to be as complete as I could.

So, for a final comparison, here is the image we finished with (click to compare to what we started with before retouching in GIMP):

mairi gimp final sharpen wavelet
Our final result.
Click to compare.

Not too bad for a little bit of fiddling, I think! I know that this tutorial reads really, really long, but I promise that once you’ve understood the processes being used, it’s actually very quick in practice.

I hope that this has been helpful to you in some way! If you happen to use anything from this tutorial please share it. I’d love to see what others do with these techniques.

Software and Noise


Software and Noise

Wonderful response from everyone

I want to take a moment to thank everyone for all of the kind words and support over the past week. A positive response can be a great motivator to help keep the momentum rolling (and everyone really has been super positive)!

Software

The Software page is live with a decent start at a list.

I posted an announcement of the site launch over on reddit and one of the comments (from /u/cb900crdr) was that it might be helpful to have a list of links to programs. I had originally planned on having a page to list the various projects but removed it just before launch (until I could find some time to gather all the links).

This was as good a reason as any to take a shot at putting a page together. I brought the topic up on the forums to get input from everyone as well. If you see that I’ve missed anything, please consider adding it to the list on the forum.

I think it may be helpful to add at least a sentence or two description to identify what each project does for those not familiar with them. For instance, if you didn’t know what Hugin was before, the name by itself is not very helpful (or GIMP, or G’MIC, etc…). The problem is how to do it without cluttering up the page too much.

Noise

I had also mentioned in this post on the forums about a neat method for basically replacing shadow tones in one image with those from second, overexposed image. The approach is similar in theory to tonemapping an HDR and is originally described by Guillermo Luijk (back in 2007).

The process basically exploits the fact that digital sensors have a linear response (a basis for the advice ETTR - “Expose to the Right”). His suggested workflow is to use a second exposure of the scene but exposed +4EV. Then to adjust the exposure of the second image down -4EV and then replace the shadow tones in the base image with the adjusted (noise-reduced) one.

I will write an article soon describing the workflow in a bit more detail. Stay tuned!

Lede image: Unnecessary Noise Prohibited by Jens Schott Knudsen cbn

It's Alive!


It's Alive!

Time to finally launch...

Well, here we are. I just checked the first blog post and it was dated August 24th, 2014. I had probably been working on the back end of the site getting things running for the basic blog setup a few weeks prior to that. It’s almost been a full year since I started working on this idea.

So it is with great pleasure that I can finally say…

Welcome to PIXLS.US!

If you’re just now joining us, let me re-iterate the mission statement for this website.

PIXLS.US Mission Statement

To provide tutorials, workflows and a showcase for high-quality photography using Free/Open Source Software.

I started this site because the world of F/OSS photography is fractured across different places. There’s no good single place for photographers to collaborate around free software workflows, as well as a lack of good tutorials aimed at high-quality processing with free software.

Tutorials

I have personally been writing tutorials on my blog for a few years now (holy crap). I primarily started doing it because while there are many tutorials for photo editing, they almost always stopped short of working towards high-quality results. The few tutorials that did try to address high quality results were all quite a few years old (and often in need of updating).

With your help, I’m hoping to change that here.

Workflows

Workflows is something that doesn’t often get described either. Specifically, what a workflow looks like with free software. For instance, some thoughts off the top of my head:

  • Creating a panorama image from start to finish.
  • Shooting and editing fashion images.
  • Taking great portrait images, and how to retouch them.
  • What to watch out for when shooting macro.
  • Planning and shooting great astrophotography.
  • How to approach landscape editing.
  • Creating a composite dream image.

These are just some of the ideas around workflows. It also doesn’t have to be only software-focused. There is a wealth of knowledge about practical techniques that we can all share as well.

Showcase

Quick - name 5 photographers whose work you love, that use free software. Did you have trouble reaching five? That’s another of the things that I would like to focus on here: showcasing amazing work from talented photographers that happen to use free software (and in some cases may be willing to share with us).

I even started a thread on the forum to try and note some amazing photographers. I will try to work through that list and get them to open up and speak with us a bit about their work and process.

By Us, For Us

I am floored by how awesome the community has been. As I mentioned on my blog, the main reason for me to write was to give something back to the community. I learned so much for so long from others before me and the least I could do is try to help others as well.

This community will be what we make it. Come help make it something awesome that we can all be proud of.

Go sign up on the forum and let your voice be heard.

Have an idea for an article? Let me know (in the forums or by email)!

Make Some Noise!

Finally, we are just starting out and are a small community at the moment. If you’re feeling up to it, please consider letting your social circles know that we’re here and what we’re trying to do. The only way for the community to grow is for people to know it’s here in the first place!

What's In Your Bag?


What's In Your Bag?

Thoughts on a next article as well

That lede image above is a quick (and dirty) snapshot of my go-to bag for running out the door. I thought it might be fun to take a diversion and talk about gear a little bit. Here’s the full image again:

Pat David Camera Bag Gear
My gear + bag. Not shown, spare battery and memory cards.

I had decided years ago on going with Micro Four Thirds (MFT) as a camera system because I like to travel light, and wanted options to adapt old lenses. (On a side note, I’m still angry that there is not focus-peaking on the E-M5…)

My camera is the Olympus OM-D E-M5 (usually paired with the 12-50mm weatherproof lens when I’m out and about). This is a perfect combination for me, particularly when I’m chasing around a 4 year old in who-knows-where situations. A water and dust resistant lens/body is nice to have.

On the far left is a Promaster 5-in-1 reflector (41 inch). These are usually relatively inexpensive and absolutely indispensable pieces of gear that can be adapted to many different situations.

I was recently reminded of this yet again while on a walk through some gardens…

Dot with/without reflector
Both images straight out of the camera, with/without reflector, same settings.

The base of the reflector (without its covering) is a great translucent scrim that is handy to use with flashes if you need to soften things up a bit (and not lug around a softbox).

Dot Eyes Open by Pat David
Speedlight shooting into the reflector scrim, ~2 feet away from model, camera left.

Speaking of flashes, you’ll also find my pair of Yongnuo YN-560 manual speedlights. I’ve been slowly teaching myself lighting with speedlights, so rarely will I not have them with me. To use them off-camera I also have a pair of Cactus V5 transceivers (one to transmit, one to receive).

Everything (except the reflector) packs nice and neatly into my wife’s old camera bag (a precursor to the Domke bags) that I ran off with. (That is, the old camera bag of my wife, not the old bag, my wife).

The bag is canvas and I waxed it myself to give it some water resistance. This basically consisted of me melting some wax and brushing it all over the bag, then using a hairdryer to further melt it into the fibers. This was a great DIY project that was relatively inexpensive (about $8USD for more wax than you’ll need) and relatively quick to do (just a few hours total).

Share Your Gear

I’d love to see what others are using out there! Take a minute, snap a photo of your gear/bag, and share it with us. Bonus points if you arrange it by knolling.

Sharpening

I was recently poked by someone on the GIMP-Web mailing list to update one of the tutorials on www.gimp.org about sharpening. I thought about it, then decided it may be better just to write some new material from scratch.

I figured why stop there? I might as well make it a fun post here taking a look at what methods we have for sharpening, why you may (or may not) want to use them, and where in the processing pipeline it makes sense. (While still pushing the GIMP specific sharpening thoughts to a separate tutorial there).

If anyone has thoughts around this or just wants to share what they’re doing, please let us know in the comments below.

Back to Writing


Back to Writing

Hiccups and Other Things

I took a bit of a break from writing articles to work on getting the forums up and running. We are almost back to a stable enough point that I want to turn my attention back to writing.

I say almost because there are still a few wonky things that I’d like to work out. There is still a little bit of an issue with the comment embeds from the forum for full-blown articles.

SSL and https

One of the reasons for the possibly strange behavior for articles in the forums is that darix convinced me to go ahead and get SSL setup for the domains. So working on it yesterday we got it running for both the main site here, as well as at the forums.

You should notice an indicator in your browser that your connection is over https somewhere (a little green lock?) for this page right now. I’ve set all connections to PIXLS.US to use SSL now (same thing with the forums).

The only drawback was that we uncovered some strange behavior when importing posts into the forum for embedding. If you care, the way things work is that:

  1. I publish an RSS feed of all of the content on the site (https://pixls.us/feed.xml if you’re curious).
  2. Every hour the forum polls this feed.
  3. If there’s new posts, the forum imports them and creates a new topic. This is what you see under the “PIXLS.US” category on the forum.
  4. Some small code on each post (on the website) references the forum topic entry to embed as comments.

There have been a couple of strange things going on with importing those posts, but darix resolved most of them. The only thing that is still strange is the article objects themselves, which at the moment show up twice in the forum.

I should not that all of this could very well be caused by my writing the RSS feeds. I know just enough to be dangerous and annoying to those who know better (this should probably be my epitaph).

Here Lies Pat David

He knew just enough to be dangerous and annoy those who knew better…

Fitting!

On the good side, thanks to the efforts of those smarter than I, even though we had some import hiccups, things have continued to run smoothly for the most part. The correct comments were maintained in the correct topic threads, and those were in turn correctly associated with the posts they belonged to (well, blog posts at any rate).

Coming soon(ish) - creating showcase posts!

Skin Retouching with Wavelet Decompose


Skin Retouching with Wavelet Decompose

A better alternative to smearing textures

Skin retouching is a delicate art.

Effective skin retouching can feel like a black art.

There have been various methods detailed in the past for ways to “smooth” skin in GIMP. Those methods ranged from disappointing at best to downright ridiculous at worst. The disappointing methods were simply a product of the best methods available at the time. The ridiculous ones seemed to be due to a lack of subtlety.

Subtlety

Subtlety is a key requirement when approaching skin retouching. There are certainly exceptions when required (high-fashion for instance) but it should always be approached from a minimalist perspective first.

Too often retouching skin is approached with a very heavy hand. In an attempt to “clean” the skin many will chase every last drop of detail out of an image, resulting in a fake and overly smoothed result (making mannequins). This is bad.

Oversmooth Mairi
To reiterate: This is bad.

Real skin has pores, bumps, spots, color, and other interesting things going on. The goal shouldn’t be to remove those characteristics, but rather to make some them less pronounced as needed. A good rule of thumb is:

“Never do more than good makeup can achieve.”

Of course, some makeup artists are magicians. In fact, it can be very helpful to go out and research how they work and what their process and reasons are. This can help you understand better how to approach all manner of retouching, particularly when using techniques like dodging/burning and color theory (as it relates to makeup and skin).

Keep in mind the context as well. Candid images may only require a very minimum of retouching (if at all), while a fashion shoot may desire a stronger application. For the best results, it helps to have a clear vision of what you want to achieve.

Tools

Blurring

One method of smoothing skin that can be found in many old tutorials on the subject involves using some variation of blurring the base image and masking the blurred regions into the image. In theory the idea may seem sound but fails quickly on closer inspection.

A combination of the broad effects of blurring coupled with the indiscriminate application across all the textures in the skin make this a less than ideal approach. All of those pores, spots, bumps, and colors get lost when using an indiscriminate function such as blurring the image. While there may be a desire to remove some of those details, visually our eyes are expecting for there to be some sort of texture and detail there. Loss of those details is what pushes the results into “mannequin” territory.

Mannequin by Horia Varlan
Mannequin territory “White male mannequin head in storefront window” by Horia Varlan (cb)

Overall, this method should not even be considered as an option for skin retouching. The results are never good and are indiscriminately too destructive to the image.

High Pass/Low Pass Frequency Separation

A slightly more advanced way to approach skin retouching is to use a “high pass/low pass” (or “high frequency/low frequency”, or just “frequency separation”) technique to separate the image into two layers. One layer would contain all of the high-frequency (fine) details while the other layer would contain the low-frequency (coarse) information.

Mairi Base by Pat David
Mairi

The resulting layers can look strange to those not accustomed to seeing them. The important thing to notice is the ability to isolate all high frequency details on a separate layer. This allows us to independently modify the colors/tones from the details.

Mairi Frequency Separation
Low Frequency (left) and High Frequency (right)
Created with a blur radius of 15px

Create Frequency Separated Layers

Creating the frequency separated layers is relatively easy in GIMP. Starting with the base image layer:

  1. Duplicate base layer
    [Layer → Duplicate Layer]
    • Name it “LF”
  2. Apply a Gaussian Blur to the “LF” layer
    [Filters → Blur → Gaussian Blur]
    • Choose an appropriate radius to isolate your desired high-frequency details (15px in the example)
    • The blur radius is ~1.5% of the width of the face
  3. Change “LF” layer blend mode to Grain Extract
  4. Create a new layer from visible
    [Layer → New from Visible]
    • Name it “HF”
    • Change “HF” layer blend mode to Grain Merge
  5. Change “LF” layer blend mode back to Normal

Visually, the result should look identical to the original base layer. Technically the separated frequency layers now allow for much finer targeted editing. The layers for the image will now have an HF layer (in Grain Merge blend mode) over a LF layer:

GIMP Layers Dialog Frequency Separation
Layers after going through a frequency separation.

The choice of radius for the Gaussian Blur operation will determine the level of details that get separated from the low-frequency layer. Smaller blur radii will isolate finer details (conversely larger radii include larger details).

Skin Retouching with Frequency Separation

Consider now the results from the separation. In particular notice which types of skin features occur in each layer.

Pores, light wrinkles, crows-feet, and small details are separated into the HF layer, while larger skin tones remain on the LF layer. Overall skin tones can be evened out out by smoothing the tones in the low frequency layer.

A note on smoothing There are various ways of softening details on the different layers.
The standard Gaussian Blur is one method that works well and quickly. Filters → Blur → Gaussian Blur…
A better method might be using a Selective Gaussian Blur to only blur certain areas (based on the value difference between the pixel in consideration and its neighbors). Filters → Blur → Selective Gaussian Blur…
If G’MIC is installed, there is also access to a bilateral blur filter (similar to Surface Blur in Adobe Photoshop) that is also an edge-preserving blur function. Filters → G’MIC…
Repair → Smooth [bilateral]

When considering a face for skin retouching it’s often best to consider each general contour area of the face separately. This is mostly due to different areas of the skin having different characteristics (ie: forehead wrinkles are often at a different scale than crows feet or smile lines).

Below is one example of a good starting point for contour consideration when smoothing. The key is to vary the smoothing intensity for each region to obtain a good result. There may not be a change required all the time, but it’s a good habit to get into for when it is needed.

Mairi Contour Smoothing Areas
Areas of smoothing consideration

A good place to start is often to address any “blotchiness” or uneven tones in the skin. (Ideally this would be addressed through the use of foundation makeup.) As seen above, those types of tones can be found on the Low Frequency layer.

Following the contour areas from above a Bilateral Blur (from G’MIC) is used to smooth the regions. When using the Free Select Tool to select a region, remember to enable Feather edges from the tool options to make a smooth transition from the working area to the surrounding image.

Filters → G’MIC…
Repair → Smooth [bilateral]

The defaults of spatial variance: 10, value variance: 7, and iterations: 2 are used.

Mairi Low Frequency Smoothed
After smoothing the LF layer with a bilateral blur
Click to compare to original

Visually, smoothing the Low Frequency skin tones provides a marked improvement to the perceived quality. Importantly, notice that none of the finer details have been modified (wrinkles, pores, etc…).

At this point, regular workflows could still be used such as spot healing or dodging & burning (on either LF or HF layers as needed).

HF/LF Summary

High/Low frequency separation is a great tool to approach skin retouching due to it’s ability to allow a retoucher to approach the work in discrete layers.

If one wanted to isolate a series of frequencies, then things get a little trickier. It would require the user to generate HF/LF separately for each size they wanted to isolate. The workflow would be along the lines of do the separation, retouch, do the separation again for a different size, retouch. Rinse and repeat.

It turns out that there is already a very handy way to isolate multiple frequencies at once and still have a visual means of combining them easily to see the edits as they are being made: Wavelet Decompose.

Wavelet Decompose

Wavelet Decompose allows you to generate multiple High Frequency layers (and a Low Frequency “Residual” layer) all at once. Each of the HF layers use the Grain Merge layer blending mode so that the composite image is reconstituted correctly. This allows the retoucher to make modifications to any of the scale (frequency) layers while seeing the results immediately on the canvas.

Getting Wavelet Decompose [Plugin] The original plugin for Wavelet Decompose by the user marcor on the GIMP registry can be found here: Wavelet Decompose [registry.gimp.org]
Once installed the command is: Filters → Generic → Wavelet Decompose …
Getting Wavelet Decompose [Script-Fu] There is also a Script-Fu version by Christoph A. Traxler that can be downloaded from us here: Wavelet Decompose Script-Fu [pixls.us]
Once installed the command is: Image → Wavelet Decompose …

The advantage to using a wavelet decomposition over a simple HF/LF separation is cases where there may be details of a different size than your HF layer that you still want to isolate.

Mairi Wavelet Decomposed Scales
Wavelet Decomposed to 5 levels
Click to view equalized levels and enhance details

Examining the equalized version of the previous image immediately shows the various scale features isolated through the decomposition. In particular, the top row shows the finest details while the bottom row shows broad details with the color residual layer last.

With the various detail scales separated, the retoucher can easily make modifications on any given scale while seeing the results directly on the canvas. This is due to the detail scale layers being set to “Grain Merge” blending mode in GIMP.

Application

Use of wavelet scales for retouching are done similarly to using a frequency separation. The major difference is choosing which detail scale to apply the smoothing operations to, and at what intensity.

I have found that a good workflow is to generally start at the largest detail scale. Experiment with smoothing methods and parameters until a good result is achieved without going too far. If needed, repeat the operations with different parameters on the next smaller detail scale (with reduced parameters).

For this example, running the Bilateral Blur from G’MIC with the same values as in the Frequency Separation example above yields:

Mairi Wavelet Decompose Smooth 5 by Pat David
Click to compare: Original Low Frequency Smooth Wavelet Smooth

The smoothing of the largest detail scale produces pleasing skin tones without removing too many details.

Having the detail scales separated out also allow for spot modifications without disrupting the textures of other scale layers. For example, there is some slight skin discoloration on the models lit cheek:

Mairi Wavelet Residual Cheek Before Highlight.jpg
A small color tone difference to repair.

By working on the color (low-frequency) Residual layer, the color tones can be evened out using a Heal Brush and sampling from nearby skin.

Mairi Wavelet Residual Cheek After
After healing the area on the Residual color layer
Click to compare to original

Notice in particular that the fine details that make up the skin composition here are not modified. Wrinkles, pores, and skin texture are kept intact while the underlying color tones for that region are blended smoothly into the surrounding area.

This same technique can come in very handy for lightening under eyes that might have dark circles under them, for instance.

Spot Healing

Once the skin tones have been smoothed as desired work can continue with spot healing discrete problems as needed. Simple skin blemishes that are discrete are best approached with a spot healing tool after the global skin tones have been modified (to avoid having to apply the healing on all of the detail layers one at a time).

Example: Nikki

A good image to see what this approach can accomplish is the lede image to this article, Nikki. This is a crop from the raw image untouched:

Nikki Base
Crop from Nikki, no retouching.

To follow along you can download the full-size base image (360KB).

Running Wavelet decompose (plugin) against the image with the default of 5 scales,

Filters → Generic → Wavelet decompose …

will leave the image with layers that look like this:

GIMP Layers Wavelet Decompose
Detail scales and residual layers from Wavelet decompose

What We’re Targeting

After running a wavelet decompose on a layer there is a very simple method of exaggerating the details that will be targeted for smoothing the skin tones. Simply toggle off the visibility of the Wavelet residual layer:

Nikki Base
Nikki with only the detail scales visible over the base image (no residual layer).

I highly recommend that you do not do this with the subject in the room! Nobody looks good when the residual scale is removed from the image stack…

But it does nicely exaggerate the types of tonal variations that are prime candidates for smoothing and suppression.

Regions

Similar to the regions previously shown, we will walk through the retouching process based on that type of facial contour: forehead, nose, cheeks, chin, and lip.

I’ll normally use the Free Select Tool with a feathered radius around one-half an iris length (~30px in this case). The radius value is mostly arbitrary and serves only to smooth the transition from areas being worked on (so adjust to taste). I will also usually select regions as I go and remember to save the selections to a channel to make it easier to come back to them later if desired:

Select → Save to Channel

Nikki Base Regions
Crop from Nikki, no retouching.

Wavelet Decompose is run on the layer using the default number of wavelet detail scales: 5.

Forehead

With the forehead region selected a first pass can be made to smooth out the tones. As mentioned previously, we’ll start on the largest detail scale Wavelet scale 5.

Wavelet Scale 5

Due to the size of the blemishes in this area, a slightly more aggressive smoothing amount can be used and adjusted to taste. A Bilateral Blur can be used again, with slightly higher values than default:

  • Spatial variance: 15
  • Value variance: 12
  • Iterations: 2

Those parameters do a good job of initially dampening the skin tones here:

Nikki Forehead Wavelet 5
Bilateral Blur on Wavelet scale 5 results
Click to compare to original

Wavelet Scale 4

There are still some uneven tones that were not affected by the smoothing on scale 5. These are mostly smaller tones around blemishes. So continuing with the same region, but now working on Wavelet scale 4 should help dampen those even further.

Using the bilateral blur again with smaller parameter values than previously:

  • Spatial variance: 7
  • Value variance: 4
  • Iterations: 1

These values are determined through experimentation on the image. They are tuned in iterations until the result is visually pleasing, then dialed back a little bit more.

Nikki Forehead Wavelet 5 & 4
Bilateral Blur on Wavelet scale 4 results
Click to compare to original

At this point, most of the skin tones have been evened out and what is left is mostly discrete skin blemishes that can be cleaned up with a heal tool later. Working on just two wavelet scales significantly decreased the prominence of the blemishes and the overall smoothness of the tones.

Nose

There is not as much smoothing required on the nose (vs. the forehead). An initial pass on Wavelet scale 5 with the default bilateral blur values:

  • Spatial variance: 10
  • Value variance: 7
  • Iterations: 2

helps to even the underlying tones nicely. A second pass on Wavelet scale 4 with much lower values on the blur help to smooth the slightly finer details as well:

  • Spatial variance: 5
  • Value variance: 2
  • Iterations: 1

These two passes result in this for the nose:

Nikki Nose Wavelet 5 & 4
Smoothing on scales 5 & 4 results
Click to compare to original

Cheeks

Similar to the first pass on the nose, the cheeks can use an initial smoothing on Wavelet scale 5 with the default values for the bilateral blur.

Nikki Cheeks Wavelet 5
Smoothing the cheeks on wavelet scale 5
Click to compare to original

To finish the cheeks a slight smoothing on scale 4 with slight values,

  • Spatial variance: 5
  • Value variance: 2
  • Iterations: 1

This smooths just a bit more than previously usually without being too much (if it is too much, dial it back of course).

Nikki Cheeks Wavelet 5 & 4
Smoothing the cheeks on wavelet scale 4
Click to compare to previous step

When clicking to compare in the above image, notice that the result of smoothing with low values on scale 4 are subtle but they are there. Combined with the previous step the overall result is a much visually smoother looking complexion without smearing details.

Chin & Lip

Considering both the upper lip and chin, and as before a good starting point is to try the default bilateral blur values on the largest scale (scale 5).

  • Spatial variance: 10
  • Value variance: 7
  • Iterations: 2
Nikki Cheeks Wavelet 5 & 4
Smoothing the chin with default bilateral blur values
Click to compare to original

Similar to the previous step a further refinement of the skin tones can be achieved by smoothing on the next detail scale down, wavelet scale 4. As before, using slight values:

  • Spatial variance: 5
  • Value variance: 2
  • Iterations: 2

Will produce a nice finishing to the detail tones in this area:

Nikki Chin Wavelet 5 & 4
Further refining the chin and lip with smaller blur values on wavelet scale 4
Click to compare to previous step

Results (Wavelet Smoothing Only)

This process relied only on smoothing the tones on the largest detail scales, 4 & 5. Without doing any targeted modifications (beyond regions) here are the final results:

Nikki Wavelet Final
End result working only on wavelet scales 4 & 5
Click to compare to original

This is a fantastic base to continue working from (particularly when compared to the starting original image). A few areas of spot healing as needed would be enough to make a great final image from here.

The concept to keep in mind when working with Wavelet scales is to build up a series of small changes that together will produce a pleasing visual result.

At this point only a few minor spot corrections and some color toning are required to reach a pleasing final result:

Nikki Final
Final result after spot corrections and color toning
Click to compare to Wavelet smoothing only

Moderation

As with many things in life, moderation is the key here. Visually it can be helpful to occasionally check your image results zoomed far out. If an image looks too smooth when zoomed out then dial it back.

Remember that this is an inherently destructive process and should be used as little as needed to get a desired result.

Resources

You can download the sample Mairi and Nikki GIMP .XCF files used to create the examples above here:

These are compressed GIMP .xcf files (hence the .xcf.bz2 file extensions). They should open directly in GIMP (created in 2.8.14) without problem.

Further Reading

This tutorial is a combination of material originally posted here:

The original wavelet decompose plugin from user marcor on registry.gimp.org (the one I use usually):

A Script-Fu version of Wavelet Decompose by Christoph A. Traxler. Place the .scm file into your scripts folder and the menu option “Wavelet Decompose …” will be under the Image menu:

An Opportunity


An Opportunity

To help (and attract) new users!

I think we are at an interesting time for digital imaging. I came across this graph on Petapixel the other day that showed camera sales from 1947 - 2014:

CIPA Camera Production 1947-2014

There was explosive growth driven by the Compact Digital market right around 2000. Likely driven by the advent of those inexpensive compact digital cameras and the ubiquity of home computers. It was relatively cheap to get a decent digital camera and the cost per photo suddenly dropped to a previously unheard of amount (compared to shooting film).

This meant that substantially more people were now able to take and share photographs.

That precarious plummet after 2011 seems frightful for the photography industry as a whole, though. The numbers from the graph would seem to indicate that production in 2014 dropped to below the values from 2001.

Petapixel had a follow-up article where photographer Sven Skafisk added in smartphone sales using data from Gartner Inc.:

Camera Sales with Smartphones

If that graph doesn’t describe an industry in the throes of change, then I don’t know what does. It looks like the camera industry is less in decline and more about being in a big transition phase.

So What?

So why would this matter? Because now, more than ever, there is a large amount of people who may be interested in learning to process their photographs in some way. As the costs and barrier to entry to photography as a hobby get lower we see more and more people finding the fun and joy of photography.

Couple that with the fact that the modern language of media consumption is primarily visual and I see a great opportunity brewing.

I feel this is important to us as free software users as it gives us an opportunity to help make people aware of free software (and its ideas). New hobbyists will invariably look for an inexpensive way to get started processing photos and will almost always run into various free software projects at some point in the search.

It’s entirely on us as a community to make sure that there will be good resources to learn from. If we do a good enough job, some of those folks will realize that free software more than meets their needs. If we do a really good job, some of those people will become valuable parts of our communities.

Articles Have Comments Now Also

So I have now also enabled the comments for more than just blog posts. They should now be working just fine on full articles as well. So feel free to head over to Ian Hex’s neat Luminosity Masking in darktable tutorial and leave a comment to let him know what you thought of it! (Or any of the other articles, too.)

A Forum


A Forum

For Discourse, if you will...

After much hard work, that basically consisted of me annoying darix as often as possible, I am glad to say that we finally have a Discourse instance set up! Super Big thank you to darix for all the help!

So What?

What does this mean? For starters, we now have a forum/community in place that we can start building around photography and free software.

A neat side-effect of this forum is that we now also have a way to embed forum threads as comments on posts (only blogposts at the moment - I’ll add them to articles shortly).

At the bottom of any blog post you should now either see a series of conversations happening with a Continue Discussion or a link to Start Discussion. Either of those buttons will take you to the actual forum to continue the conversation. Replies to topics that are tied to posts will show up as a conversation at the bottom of the post (check the bottom of this post).

The site is open and live at the moment (if a bit bare-bones). Feel free to drop by and create an account, comment on things, start new topics, etc. I’m testing things out at the moment to see if I need to possibly bump the server specs in order to handle the loads (most likely). (In the course of writing this, I went ahead and bumped the server RAM to 2GB - so it should run smoothly).

All the Articles


All the Articles

My God, It's Full of Articles

I spent a little time struggling conceptually with how I wanted to categorize the different types of content I am planning for this site. As I had previously noted, I was already done with creating a blog post type of content, and had noted that I was working on how to show tutorials and ‘showcase’ types of posts.

Apparently, I had the answer in mind when I created that graphic last month. If you notice the two other types of content I am working on, Tutorials and Showcase, are both listed as types Articles on the graphic.

site content types - Blog, Tutorials, Showcase

Of course. There will only be two distinct types of content from the viewpoint of the site, blogposts and articles. I will then use the features of the static-site generator I use for this site, metalsmith, to manage the content presentation (tutorials, showcase, etc). This will be handled through collections in metalsmith.

So at the end of the day, even though there will be a section of Tutorials and Showcase or whatever else I come up with (or someone else), the bottom line is that the base content object will be an Article.

I like this approach, as it leaves a large amount of flexibility while maintaining a nice sense of simplicity. (Anything that lowers the barrier to writing and publishing material is good in my book).

An Aside on Collections in Metalsmith

This is just a note to myself in case I forget what I was on about with collections.

There are basically two ways of associating an article with a collection, through metadata on the file and through a matching pattern during compile time. Unfortunately, as near as I can tell, you can’t do them both at the same time for the same collection type.

Metadata

Doing it through metadata assocation only requires that in the front-matter of the file, the collection type is called out, like collection: tutorial. For example, here’s a sample of the front-matter for this blog post:

---
date: 2015-03-30T17:31:36-05:00
title: "All the Articles"
sub-title: "My God, It's Full of Articles"
lede-img: "M31 - Adam Evans.jpg"
author: "Pat David"
collection: blogposts
layout: blog-posts.hbt
---

In this case, the post will be added to the collection, blogposts.

Pattern Matching

In the index.js for the site, there’s a section for using collections where a pattern can be specified to add files:

.use( collections({
    articles: {
        pattern: 'articles/*/index.html',
        sortBy: 'date',
        reverse: true
        }
}))

This glob pattern will simply add all the posts in a folder in the articles/ directory to the collection, articles.

In fact, this is actually how I want to collect all articles on the site for archive purposes. I’ll want a page on the site that will list all of the articles that will be published, regardless of further classifications. I feel that it is helpful for people searching for information to have a single page listing of all the material on the site (I did something similar with my blog by adding an archive page).

Happy!

So these pieces sort of falling into place make me happy because it means that I am much closer to having a setup how I would like it to be. I can get started writing these other article types now without worrying as much about the back end.

Rather, I only need to focus on creating the landing pages for the content type (tutorials/, showcase/, etc…). Yay! More time to spend on writing new stuff!

Discourse

Discourse Logo

I had mentioned it previously, but darix on #darktable has been an immense help in testing out Discourse for me. He has gotten it to a point where it mostly works so the only thing holding me back from getting it rolled out is deciding how/where to host the instance.

If anyone has any thoughts or suggestions, I’m all ears! To use Darix’s discourse, I’ll need openSUSE 13 at least. Otherwise, I could probably buy a droplet on Digital Ocean and host it there for now.

Deep Links


Deep Links

As well as a sort-of look for article/tutorial indexes

Deep Thoughts by Jack Handy

I tried to find a good funny reference to Jack Handey here but failed. Which might be a good thing given how the reference likely shows my age…

I have been working on various bits of the site as well as finishing up a long-overdue article. I’ve also been giving some thoughts in general about interesting ways to move forward with some ideas which I will bore you all with shortly.

Deep Linking

A while back I had some thoughts around how best to format long form articles. I finally decided to keep articles entirely on a single page as opposed to breaking them up across multiple pages. Mostly this was because I know I personally hate having to click through too many times just to read an article, and the technique is often used as a cheap means to show more ads to readers.

The problem with single page articles is linking/referencing content at an arbitrary location in the page. The markdown processor I’m using in metalsmith does add a unique heading id to each html heading element, but doesn’t expose the link easily.

So I spent some time recently writing a small metalsmith plugin to do that for me. In the articles you can now get a direct link to a heading section by hovering the mouse pointer over a heading. The link will become visible at the end of the heading (as a link icon):

PIXLS.US deep link example
The link becomes visible when hovering over a heading.

This lets you now link directly to that section. So I can now link directly to content deep into the page itself, like this link to the Nikki example for skin retouching.

These are the same heading links that are used for the Contents navigation pane on the menu:

PIXLS.US Navigation Menu

This method of exposing a heading link is similar to what you may find on GitHub for instance. So, at least there’s now the ability to deep-link into articles as needed! :)

Skin Retouching with Wavelets

Also, I took a break from this other thing I’m working on to finish writing the Skin Retouching with Wavelet Decompose article.

Nikki by Pat David
Nikki is a sample image from the Skin Retouching with Wavelets article.

This poor article has been in the queue for what feels like forever, so it’s nice to finally be able to publish it. This particular article is a combination of many of the previous things I had written around using wavelet scales for retouching work. If you get a chance to read it, I’d love to hear what anyone has to say about it!

Articles Index Page

I’m still experimenting with the look and feel of the articles index page. If you follow that link you’ll see one of the ideas I currently have for laying it out. I’m not 100% sold on this layout yet, as it may get cumbersome with many articles at once.

I may also provide links at the top of the page for particular content (tutorials, showcases, by tag/software, etc…).

Speaking of which, I’m wondering from a content management standpoint if it makes more sense to publish every item on the site as an “article”, then to handle the categorization and display as a function of tags/categories on the posts. Not quite sure just yet. I’ll still need to fiddle with some other layout/organizational ideas.

On Another Note

I finally also fixed the path problem when generating the blog post listing page. I had a problem where locally referenced images for a post (relative to the post directory) didn’t have their paths updated when showing them on the blog index page. So I took some time and repaired it with a small handlebars helper function.

For instance, the Deep Thoughts image at the beginning of this post wasn’t showing correctly from the blog index page before I fixed it.

Some Updates


Some Updates

Yes still writing and working!

I hate when things take me away for a little while, but won’t make any apologies just yet for having little activity here! It’s mostly a one-man show here at the moment so I do beg for some patience as I build things out and get articles together.

Speaking of building things out…

Site Structure

I have been giving some thought to the general site structure lately. I thought it might be fun to talk about it briefly.

My original (and still current) intention for the main piece of content for PIXLS.US is a tutorial. It’s the main type of content I was writing on my blog as well as what I’ve been trying to update on http://www.gimp.org/tutorials. It’s a nice, known quantity…

So I spent my early time building the site focusing on the layout and design of tutorial pages. Fonts, sizes, weights, layout, and more. It’s just the way I think. Plus, if I did a decent job on this layout, I could not worry about fiddling with it later and instead focus on writing.

I finally ended up with a layout that I liked (basically what you’re reading on right now). The problem was, I wanted a bunch of tutorials, not just one!

So with a little work and the help of some contributors (yay Ian Hex!), I was looking at a few different tutorials now for the site. Yay!

The problem now was that I needed to create a nice page to help guide users to the various tutorials. This is still not done…

So here I am at the moment still working on how best to showcase the neat tutorials on an index page of some sort:

I need to find an attractive and usable means of listing the various tutorial articles. So this is one of the things that has been taking up some of my time.

The main page has also been occupying some of my attention, as I’m not 100% sure how to present all the site information (tutorials, blog posts, showcases, etc…). There’s kind of a running theme here I guess.

I’m also going to be trying to produce some “Showcase” type of article posts that will highlight a F/OSS photographer or images.

The blog pages I’ve already finished (it’s what you’re reading now). I’ve also mostly gotten the index pages for the blog in a workable state. I took some time recently to paginate the blog index pages as well so as to not try to load the entire post history on a single page.

To summarize, there are a few things yet to design and code. I’m working on getting them so we can have an actual launch.

  • Main Page

    I still need to design and layout how best to show off the site content.

  • Tutorial/Articles Page

    This is another page to design and layout. I have some ideas and neat content already written, so this is just designing the page.

  • Showcase Pages & Index

    These pages will be functionally the same as the article pages, but the content will focus more on showcasing FL/OSS artists and their works. I’ll categorize these pages differently so I can collect them on their own index page separate from the tutorials.

In Closing…

So, things are moving along (albeit slower than I would like). I’m building the scaffolding for the future, so I don’t feel so rushed. Better to do it well than quick in my opinion.

Contributing

Also, if anyone would like to immortalize themselves on the early pages of an experimental website to bring high quality tutorials and discussions to the the Free/Open Source Imaging world – well then you know where to turn: pat@patdavid.net.

I promise I don’t bite (hard).

Another Article Done


Another Article Done

Ian Hex and Luminosity Masks in darktable

2015 seems to be getting started nicely!

Just before the holidays Ian Hex sent me his finished tutorial to post, and I just finished editing it. It’s a wonderful look at using Luminosity Masks in darktable for targeted adjustments. (Parametric masks in darktable-speak). You can find the new tutorial here:

PIXLS.US: Luminosity Masks in darktable

On a side note, I had previously written about doing Luminosity Masks in GIMP on my personal blog, and yes I will be porting that tutorial here a little later!

Still Writing

I am still working on the Wavelet article (I took a break to copyedit Ian’s article). I am continuing my work on that article as well as taking a rudimentary first stab at an article index page (or possibly a variation for a main landing page for the site).

Just need to decide on an attractive and functional layout for presenting the list of articles we have available. I’m also open to suggestions if any of you readers out there have seen something that you think would be appropriate or neat to consider…

I am also open to taking submissions from folks who may have the mental fortitude to write something for the site. Just shoot me any ideas/sketches/outlines you think may be appropriate! (pat@patdavid.net in case you didn’t already have it…)

Luminosity Masking in darktable


Luminosity Masking in darktable

Making targeted adjustments to your RAWs

Luminosity Masking, the ability to create selections of your image based on its specific tones for ultra-targeted editing, is a relatively recent concept favoured by landscape photographers the world over. In this article, we will explore how to create and use Luminosity Masks in the F/OSS RAW editor darktable, so that you can make adjustments on your RAW files to isolated tones.

What is Luminosity Masking?

Luminosity Masking is a technique developed in the last 10 years or so primarily by American Southwest landscape photographer Tony Kuyper over at goodlight.us. Tony provides extensive writing and information on Luminosity Masking and how to create Luminosity Masks; in this article I’ll be primarily focusing and creating and using the masks in darktable, but if you want to really understand the basics I highly recommend giving Tony’s guide a good read over first.

In essence, Luminosity Masking is about creating highly specific selections of your photo based on the tones of the image itself. This enables you to have extremely fine control over what parts of the photo are selected to make adjustments on (such as contrast, saturation etc.) whilst keeping other tones of the photo completely unaffected. Let’s quickly illustrate this with some screenshots.

Ian Hex darktable luminosity mask tutorial

Here’s a shot I got of the Coral Beach on the Isle of Skye, Scotland, when my partner and I toured there recently in October 2014. It’s a pretty solid exposure. Let’s have a look at the histogram.

Ian Hex darktable luminosity mask tutorial

This article assumes you already have a basic understanding of histograms and how they work but I’ll give a quick summary here: the histogram represents the tonal information of your photo. It’s a graph of the light. On the left-hand side of the histogram is where all the Shadow information is, all the darker tones of the image. On the right-hand side you’ll find all the Highlight information, the brighter tones. And therefore, towards the middle of the histogram, is where all your midtones are located. The taller the graph is in a certain section of your histogram, the more information there is. So for this photo, you can see that we have a lot of shadow and highlight information, but hardly any midtones. We’re also not clipping (losing information) any shadows and highlights as well i.e. the graph isn’t flattened against either side of the histogram. So we’ve got plenty of room to work with here.

So let’s say that I feel the sky is a little too bright and I want to darken it. The day was quite overcast at this point and the sky in this image feels too washed out. Let’s darken it by dropping the exposure.

Ian Hex darktable luminosity mask tutorial

Now we’re starting to see some more definition in the sky but the image overall feels too dingy and dark. Let’s look at the histogram.

Ian Hex darktable luminosity mask tutorial

As you can see, underneath the histogram I have the Exposure module open and I’ve pulled the exposure of the photo down by -1.02EV, darkening the image. This is reflected in the histogram. What was previously highlight information has been brought down so that it now resides in the midtones of the photo. This has brought back some definition and colour to the sky but now the rest of the photo is too dark; you can see on the histogram that the shadow information is bundling up on the left-hand side and we’re in danger of clipping the shadows, that is, losing information, which would result in blotches of pure black in the photo. Not good.

How do we get around this? Well, we create and use a Luminosity Mask that selects just the highlights in the photo, mostly the sky, but leaves the rest of the photo alone, keeping the shadows where they are. Here’s the result of using a Luminosity Mask to darken just the highlights in the photo.

Ian Hex darktable luminosity mask tutorial

Much better. We’ve darkened the highlights, the sky, bringing back some colour and definition but have left the shadows, the beach and grass, well alone. Let’s see how our histogram is doing.

Ian Hex darktable luminosity mask tutorial

Once again, I’ve opened up the Exposure module and dropped the exposure of the photo down to -1.02EV but you can see that the module looks a little different this time. That’s because I’ve applied a Luminosity Mask to the Exposure change. We’ll come back to that in a bit. Look at the histogram in the top-right. We’ve brought the highlights down into the midtones but kept the shadows where they are. We can make another targeted adjustment if we want. Let’s say that I want to brighten the shadows a little bit as well.

Ian Hex darktable luminosity mask tutorial

Ah-ha! Now we’re bringing back some clarity and interest to the foreground, that lovely sweeping curve of the grass, beach and loch, with the hill in the distance. Check out the histogram.

Ian Hex darktable luminosity mask tutorial

You can see at the bottom-right that I’ve made a new adjustment, known as “Exposure 1”, where I’ve increased the exposure of the image by 0.72EV. But again, I’ve applied a Luminosity Mask to this adjustment so that the brightening effect only happens to the shadows in the photo, leaving the highlights alone. In the histogram, you’ll note that we now have a lot of midtone information, by darkening the highlights and brightening the shadows. Tony Kuyper talks alot about the “Magic Midtones” and for good reason: the midtones are the real meat of the photo and applying targeted adjustments to the midtones of a photo can really take your work to the next level.

So, let’s review the changes we’ve made to this photo.

Ian Hex darktable luminosity mask tutorial
Fig. 1: Original RAW
Fig. 2: Whole photo darkened
Fig. 3: Highlights darkened only
Fig. 4: Shadows brightened as well

And let’s also look at how the histogram has changed.

Ian Hex darktable luminosity mask tutorial
Fig. 5: Original RAW
Fig. 6: Whole photo darkened
Fig. 7: Highlights darkened only
Fig. 8: Shadows brightened as well

Creating Luminosity Masks in darktable

Luminosity Masking is easy to do in darktable; it’s built right in to the software since v1.4 (and now we’re on v1.6). Every single module in darktable, whether that’s Contrast, Vibrance, Exposure etc., can have a Luminosity Mask applied to it for targeted adjustments. Let’s demonstrate on a new image.

Ian Hex darktable luminosity mask tutorial

Here’s a shot I grabbed on that same tour of Scotland in October 2014, this time of the Glenfinnan Monument. Pretty neat? If you look at the histogram at the top-right, you’ll see that I have a lot of shadow information (in fact it’s almost clipping) and I have a good range of highlight information that moves into the midtones as well. Thankfully there’s no clipping going on but the photo is too dark, with the monument and mountains appearing almost as shadowy silhouettes against the sky. What we want to do is to brighten up those shadows to bring back the details and colour in the monument and the mountains. We may also do a smidgen of highlight darkening as well.

So, let’s open the Exposure module and I’ll walk us through it.

Ian Hex darktable luminosity mask tutorial

You can find the Exposure module in the Basic Group, represented by the hollow white circle icon.

The magic we’re looking for is under the “blend” dropdown:

Ian Hex darktable luminosity mask tutorial

Simply select “parametric mask”. This is where the magic is. In my view, it should be renamed to Luminosity Mask, but that’s just me.

This is where we can create a mask of the photo by selecting just certain tonal ranges. Now, we’re not going to go into detail on every aspect of this masking system; I’ll leave to you to experiment with. Just note that this “parametric mask” function is available in every darktable module, so you can apply Luminosity Masks on Exposure, Saturation, Contrast, Vibrance, Local Contrast… whatever you wish. This is neat and very powerful.

So, next step: select the “L” tab for “Luminosity” – located on the far right of the other tabs “g”, “R”, “G”, “B”, “H”, “S” — and then select the little icon that has the black circle in the white square, this will show the mask.

Ian Hex darktable luminosity mask tutorial

This is what your photo will now look like.

Ian Hex darktable luminosity mask tutorial

Don’t panic!

All this yellow is telling you is that, currently, any Exposure adjustment you make will take effect on the whole photo. Clearly, this isn’t what we want. What we’re going to do is adjust the Input slider to start narrowing down our selection to just the tones we want; in this case, we’re after the shadows so we can brighten them up whilst leaving the highlights alone. We can do this by bringing the sliders on the right-hand side of the Input slider down towards the left. This will start deselecting the highlights of the photo as we narrow our mask further towards the shadows.

Ian Hex darktable luminosity mask tutorial

As you can see, I’ve brought the Input sliders from the right-hand side down to 25, very close to the left-hand sliders. This is reflected in the mask, as we’re now starting to deselect some of the brighter highlights in the sky. But we want to narrow it down further so that we’re targeting just the darkest parts of the photo: the mountains, foreground and monument.

Ian Hex darktable luminosity mask tutorial

Boom! We’ve had to bring the sliders down all the way to 5 to cut off the highlights in the sky. We’ve also managed to deselect some of the brighter highlights in the foreground as well. Let’s just make one final adjustment to the sliders before we start brightening the Exposure.

Ian Hex darktable luminosity mask tutorial

Here, all we’ve done is move the bottom right-hand slider back up towards the highlights a little bit. What this does is feather and soften the mask so that when we do our Exposure brightening it will look more natural and blend better.

OK, we’ve got our initial mask targeted nicely towards the shadows; hide the mask by selecting that black circle in the white square icon again. Now it’s time to start brightening up the Exposure.

Ian Hex darktable luminosity mask tutorial

Boom! Much better. Let’s do a side-by-side comparison.

Ian Hex darktable luminosity mask tutorial
Fig. 9: Original RAW unedited
Fig. 10: Foreground, monument and mountains (shadow areas) have been brightened through a Luminosity Mask, leaving the highlights in the sky alone.

Already, we’ve made a striking change to how the photo looks. There’s now a lot more interest as our subject, the monument, is much brighter with plenty of details available. However, we’re not quite done. The sky to the right of the monument looks a bit… funky. That’s because when we feathered our Luminosity Mask a bit we selected too much highlight information. This has resulted in part of the sky getting brighter but the rest of the sky staying the same, which looks strange. We can correct this by moving the bottom right-hand slide back to the left a bit, cutting off those highlights in the sky more.

Ian Hex darktable luminosity mask tutorial

Better. By moving the bottom right-hand slider back down from 20 to 8 the sky looks more natural.

Already, this photo is looking a lot better. Let’s take some of those bright highlights in the sky and darken them a bit, so that the eye isn’t distracted and focuses more on the monument. To do this, we’re going to make another Exposure adjustment.

Ian Hex darktable luminosity mask tutorial

To the left of the Exposure module name you’ll see four little icons. Click the rightmost one and then select “New Instance” in the dropdown that appears.

Ian Hex darktable luminosity mask tutorial

We now have a new module called “Exposure 1” that sits on top of our previous Exposure module. With this Exposure 1, we’re going to create a Luminosity Mask targeting the highlights so that we can darken the exposure in them.

Same process as before: in “Exposure 1” select the “blend” dropdown then select “parametric mask”.

Ian Hex darktable luminosity mask tutorial

Select the “L” tab for Luminosity then make the mask visible by clicking on the black circle in the white square icon.

Ian Hex darktable luminosity mask tutorial

This time, we’re going to take the left-hand sliders and bring them to the right, slowly deselecting the shadows until we’ve targeted the highlight tones we want to darken.

Ian Hex darktable luminosity mask tutorial

In our example, we’ve taken the left-hand sliders of Input up to 17 and then brought the bottom left-hand Input slider back down a little to 6 so that we feather the mask out for a more seamless blend.

Let’s start decreasing the exposure to see what it looks like. Just click on the black circle in the white square icon again to hide the mask and starting decreasing the exposure slider.

Ian Hex darktable luminosity mask tutorial

Nice! Here, we’ve brought the exposure down by -0.50EV through our Luminosity Mask, targeting the highlights and darkening them. We’ve also tweaked the bottom left-hand slider by bringing it down to 3 for a bit more feathering.

Here’s a before and after.

Ian Hex darktable luminosity mask tutorial
Fig 11: Shadows brightened only via a Luminosity Mask
Fig 12: Brightest highlights darkened through a Luminosity Mask in a new exposure adjustment.

Giggedy. So this photo is starting to look pretty sweet. Let’s just make one more adjustment, globally this time with no Luminosity Mask. I want to generally increase the overall exposure of the photo.

Ian Hex darktable luminosity mask tutorial

Good! As you can see, on the right-hand side I’ve created another Exposure module, now called “exposure 2” and have increased the overall exposure of the photo by 0.50EV.

To round up this tutorial, let’s look into making one more adjustment through Luminosity Masks. Now that we’ve brightened up the shadows and darkened down the highlights, we’ve moved a lot of the tones in the photo towards the midtones. This is where the real meat of the image is. We can now really give this photo some punch and pop by applying some contrast to just the midtones of the image. Here’s how.

Open the Contrast, Brightness & Saturation module, select “blend” then select the “parametric mask” option in the dropdown.

Ian Hex darktable luminosity mask tutorial

You’ll note this time round that the tabs in the module—the “L”, “a”, “b”, “C” and “h”—are different to the Exposure module. Don’t worry. Just leave the “L” for Luminosity selected. We’re now going to adjust the Input sliders so that we’re targeting just the midtones of the photo. We do this by deselecting both the highlights and shadows. This is done by moving the left-hand sliders up and the right-hand sliders down towards the middle.

Ian Hex darktable luminosity mask tutorial

So here’s how my midtones Luminosity Mask looks. On the right, you can see that I’ve brought the sliders towards the middle and then dropped the bottom slider of the pair away so that there’s some feathering. This is quite a tight midtones mask but that’s OK. Now let’s hide the mask and start increasing the contrast.

Ian Hex darktable luminosity mask tutorial

Much better. Because we’re only targeting a tight selection of the midtones we can make quite an aggressive contrast adjustment (I’ve brought the contrast slider way up to 50). I’ve also increased the brightness of the midtones a little, pulled down the saturation to compensate for the contrast adjustment, and also increased the blurring of the mask to 100, feathering out the mask further for a more natural adjustment.

Let’s look at the before and after.

Ian Hex darktable luminosity mask tutorial
Fig. 13: Our RAW with the shadows brightened and the highlights darkened
Fig. 14: Contrast increased in the midtones through a Luminosity Mask

You can see the biggest difference this contrast adjustment made was to the texture in the foreground grass and the stone detail in the monument. You can make out the individual clumps of growth in the foreground as well as the individual tones in the stone of the monument. Neat.

Finally, here’s an overview of the adjustments we’ve made to this photo

Ian Hex darktable luminosity mask tutorial
Fig. 15: Original unedited RAW
Fig. 16: Shadows brightened through a Luminosity Mask
Fig. 17: Highlights darkened through a Luminosity Mask
Fig. 18: Overall exposure increased a little, no mask
Fig. 19: Contrast in the midtones increased through a Luminosity Mask.

Conclusion

In this tutorial, I’ve only gone through the very basics of what is possible with darktable’s Luminosity Masks, so that one can make subtle adjustments to the shadows, highlights and midtones of their photo in order to balance the image better. But Luminosity Masks can be used for so much more and so I invite you to experiment! Try out the different modules available in darktable and see how you can apply various filters through different masks to achieve highly-specific adjustments to your RAWs like never before.

Still Writing


Still Writing

Yes, things are still moving (slowly) along

It’s been a busy month (+ ½) for me personally. Things have finally settled down so I can get back to writing articles and working on the site.

Wavelets Coming

As I mentioned in the previous post, I’m currently working through a re-write of the various tutorials I had done about using Wavelet Decompose for skin retouching. I’m about 23 of the way through it now and expect to have it finished shortly.

Guest Writer Ian Hex

I also previously mentioned that I’ve been reaching out to a few folks to see if they might be interested in writing some articles for the site. I’m extremely pleased to say that Ian Hex is stepping up to the plate with a neat tutorial about darktable that is being written right at this very moment!

If you haven’t had a chance to see Ian’s work I highly recommend stopping by his site at http://lightsweep.co.uk/ to get a gander at some epic images from the UK. I desperately want to hop on a plane and visit after seeing them!

His self-professed mission is:

..to show off the beauty of British landscapes and architecture to the world

and I’d say he’s doing a bang-up job of it so far!

Fire of Whitby Abbey by Ian Hex (cbna)

Wonder of Variety by Ian Hex (cbna)

Ian will be writing about Luminosity Masks in darktable. Given his results and body of work I am personally looking forward to this one!

Maybe if we get a good enough response with his post we can convince him to come back and write some more…

Iterating


Iterating

Minor changes and another tutorial

I’m working my way through some of the suggestions I’ve received from many folks. In particular, the “px” icon in the upper left to slide open the navigation and Table of Contents has been changed to a (hopefully) more familiar ‘hamburger’ icon. I’ll also be testing some other things in the coming weeks as time permits such as having a TOC show up by default in the right ⅓ of the page at the top.

Don’t expect it too soon as I want to focus on writing more content first. I’m aiming for a December-ish timeframe for a more official launch and want to make sure there is a decent amount of material for folks to consume.

The Next Tutorial

Speaking of material, I’m starting work on a tutorial for skin retouching with wavelet decompose. I’ve written about this many times before, but want to port the ideas over here.

Dot Eyes Closed Wavelets
“Dot Eyes Closed” wavelet decomposition

I have a few extra thoughts surrounding the use of wavelets as well as some minor changes in my workflow with them that should make a new writeup more interesting (hopefully). I’ll also focus specifically on skin retouching as opposed to some of the other things that can be done with wavelets.

More Support

I have reached out to some of my favorite amazing photographers using F/OSS in their workflows and the response has been overwhelmingly positive. I’ll speak more about the folks in a later post, but I am personally very thankful that they have taken the time to respond and that it’s been so positive!

❌