Support my work on Patreon

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

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

Total Pageviews

Saturday, September 13, 2014

Tutorial: how to process a RAW image in photoflow

This tutorial will teach the basics of loading and processing RAW digital images in photoflow.

Photoflow can curently open any RAW image in Bayer format that is supported by LibRAW 0.6.0. Work is ongoing to port the RAW loading backend of RawTherapee into photoflow, but the code is not yet fully functional. Once this will be finished, support for other RAW formats (like X-trans) will be hopefully included quite quicly...

Although the RAW processing in photoflow is still under development, it provides already a quite complete set of features: white balance can be adjusted starting from a neutral image area or by specifying a target color tone, you can choose between Amaze and IGV demosaicing algorithms, and it gives the possibility to switch between the standard dcraw matrices and a custom camera profile for the final conversion to the working color space.

To simplify your life when processing several images taken under similar shooting conditions, the RAW processing parameters for one image can be saved as a preset and then recalled and applied to the rest of the images of the same shooting session. This allows to speed-up your editing work and also to keep a consistent post-prcessing across all the images of the same sequence. You will find more details about that at the end of the tutorial.

The RAW processing in photoflow is similar to that of other image editors, and probably not as feature-rich yet, however the code is growing quite quickly. Since most of the algorithms are a port of the original RawTherapee code, one can expect a similar output quality once all features will be implemented.

Step 1: How to open a RAW image file

Opening an existing RAW image is very simple. You can either do that by passing the file name as a parameter when invoking photoflow from the command line, or by cliking on the "Open" button and selecting a RAW image from the file selector dialog.

The operation of opening the RAW file will most probably take several seconds, as the program will first decode the whole image into memory, save the decoded data into a disk buffer, and perform a first demosaicing to initialize the scaled-down versions of the full-res image for faster zooming.
Once the loading is finished, you should see a very dark and dull version of the RAW image: this is because no post-processing is applied at this stage, and therefore the program shows you the original RGB values in linear colorspace.

Step 2: Process the RAW file

In order to process the RAW image (white balance, demosaicing, exposure comensation, etc...) you need to add a "RAW Developer" layer on top of "RAW loader". To do that, click on the "+" button at the bottom of the layers list, select the "raw" tab in the tool selection dialog, and select the "RAW developer" tool. Your photoflow window should look something like this:

Click "OK" to add the RAW developer layer. At this point the image should look much more familiar, with colors that are at least reasonable and a correct brightness.
By default, the RAW processor applies the camera white balance and the Adobe matrices for rendering the colors, producing an output image in the sRGB colorspace. However, all those parameters can be changed and tweaked in real time.

The controls of the RAW developer are organized in four tabs: "White balance", "Exposure", "Demosaicing" and "Output"; let's see each of them in detail...

White balance tab

photoflow currently supports three white balance (WB) modes:
  • "CAMERA": this is the white balance setting used by the camera when shooting the image. Three sliders allow to move the red, green and blue multipliers away from their in-camera values, allowing a precise fine-tuning of the result.
  • "Spot": when this mode is selected, you can click with the mouse on a gray or neutral area in the preview image to determine the correct white balance. Three sliders let you tweak the WB multipliers by hand if you feel that some further fine tuning is needed.
  •  "Color spot": this mode works similarly to the "Spot" one, except that you can specify the target color of the image area on which the mouse click occours. Three boxes allow to define the target color in terms of Lab values. Presently only the "a" and "b" values of the target color are used to adjust the white balance. Again, three sliders let you tweak the WB multipliers by hand if you feel that some further fine tuning is needed. Here is how the color spot controls look like:

The "Color spot" mode is particularly useful to quickly find a good starting point whenever you are faced with a shot without a clear neutral region and/or taken under uncertain light conditions. For example, I often use it for portrait shots taken under shadow: in this case, just select a target skin tone (for example "a=8, b=9" might be a good starting point, but you are free to experiment depending on the actual skin tone of your model...) and click on some good skin area (the forehead, neck, etc...). This mode might also be useful if some area of your picture has a well-defined but not neutral color.

Other WB modes like "daylight", "thungsten", "flash" etc... are planned for one of the next photoflow versions.

Exposure tab

This tab contains one single slider which allows to change the overall exposure of the image. The values of the slider are in ISO units: a value of +1 equals one stop of overexposure.

Demosaicing tab

In this tab you can choose the demosacing method applied to the RAW image, and tune the post-demosaicing false color suppression.
The demosaicing algorithms and post-processing are directly derived from those found in RawTherapee.
Three methods are proposed:
  • "Amaze": this method allows to preserve the highest amount of detail in the image, and is better suited for low-ISO shots that are not too noisy.
  • "IGV": this method provides a pleasing "grainy" result when applied to high-ISO, noisy images and might be better than Amaze, in particular if you plan to apply some noise reduction filter to the image.
  • "Fast": this is a low-quality, high-speed method that is used internally to produce the scaled-down versions of the full image for fast  zooming. It might be useful to speed-up the image processing when initially tweaking the image at 100% zoom level, but it should never be used for the final image editing.

"False color suppression steps" slider (from RawPedia): sets the number of median filter passes applied to suppress demosaicing artifacts when applying the demosaicing algorithm. False colors (speckles) could be introduced during the demosaicing phase where very fine detail is resolved. False color suppression is similar to color smoothing. The luminance channel is not affected by this suppression.
The default value of two steps should generally give good results.

Output tab

In this tab you can define how the RGB values of the demosaiced image should be interpreted and converted to the working colorspace of your choice. Three methods are currently proposed:

  • MATRIX: the colors are rendered using the color matrices from dcraw. From RawPedia: "A color matrix is a matrix of 3x3 constant values which is multiplied with the camera's native RGB colors to convert them to colors which are as natural as possible. A color matrix works best (i.e. provides more accurate colors) when the white balance is close to what the matrix was calibrated for. The camera standard matrix is calibrated for D65, i.e. 6500K. Do not worry if the white balance is quite far off from that though, color will be reasonably accurate anyway."

  •  ICC: in this case you have to specify a custom input profile for your camera. Camera input profiles can come from different sources (custom-made from an IT8 target, bundled in some third-party software, freely provided by other users, etc...). In the next tutorial I will show how to use the Nikon camera profiles that are automatically generated by Capture/View NX in order to precisely reproduce the Nikon colors in photoflow. Custom camera profiles might need some pre-processing of the image data before being applied: photoflow allows to apply an sRGB or custom gamma curve to the image data; use this options if your camera profile produces very dark images without any pre-processing. You might need some experimentation to find the good settings: for example, Nikon profiles from Capture/View NX require an sRGB tone curve. If you find a good setting for a given camera/profile combination I'll be glad to add that to the documetation.
  • NONE: this choice completely disables the color management, and gives access to the uncorrected linear RGB data after demosaicing and WB. You can apply an RGB or custom gamma tone curve to give the image a "natural" brightness.

Output profile selector: this selector lets you choose the working colorspace into which the image data should be converted. In addition to the standard sRGB colorspace, the AdobeRGB and ProPhoto profiles are provided if you need something covering a wider gamut.
If you choose the "custom" value then you will have to specify the file name of the ICC profile in the "output profile name" text box at the bottom of the dialog.

Here is how a processed image looks like:

Step 3: Saving the RAW processing parameters into a preset

If you have a series of images that have been taken under similar shooting conditions, and which should have a similar "look & feel" for artistic "consistency" reasons, you can automatize part of the work by making use of photoflow's ability to save and reload "presets". The procedure is very simple:
  1. choose one image and tweak all the RAW processing parameters until you are satisfied.
  2. 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)
  3. choose an appropriate file name and location for your preset; the preset file name must be given a ".pfp" extension
  4. save your current image as a ".pfi" file (this time you have to use the "Save" button above the preview area, close to the top-left corner of photoflow's window) and close it
  5. open the next RAW image file to be edited
  6. click on the "Load" button below the layers list widget (at the bottom-right of the photoflow's window)
  7. choose the preset file you just created at step 3
The RAW processing parameters saved in the preset should now be applied to the newly opened RAW image... you can repeat that for all the images in your sequence, thus giving to all of them a consistent exposure, WB and color rendering.

The use of presets is not limited to RAW processing parameters: any sequence of layers can be saved and re-loaded. You can thus store your preferred processing techniques and re-call them very quickly whenever you need...

No comments:

Post a Comment