Photographic Editing - Workflow

Image Editing/Workflow Tools

A Standard Workflow Proposal

When performing a basic workflow, the primary areas for consideration are:

  1. Exposure: White Balance

  2. Color: White Balance

  3. Black and white points: White Balance or Adjust Levels

  4. Contrast: Adjust Curves

  5. Saturation: White Balance or Vivid or Hue/Saturation/Lightness

  6. Resizing (interpolation) : Change Size

  7. Sharpening

  8. Digital Asset Management (applying tags, captions, rating, geolocation, save under new name)

We recommend this sequence of image editing steps to ensure optimum photographic quality for the end product. In particular, never do sharpening before the last step. And we recommend using a lossless format like PNG or TIFF for storing photographs. Otherwise you'll lose a bit every time you save the results. If you can afford it, use 16 bit/channel for your best shots. If you want to change color space, in particular if you want to work in CIEL*a*b, 16 bit per channel are required to avoid truncation effects.

If you swap step 4 and 5, which is well possible if the initial contrast is already very good, you can do the first 4 adjustment in the same plugin, the white balance

Many of the tools you may need for photographic editing are included with digiKam. Their description follows here.

Introduction to common editing tools features

All Image Editor tools like Sharpen, Blur, Noise Reduction, Refocus, Unsharp Mask, etc. use a common dialog style that previews the effect before applying the filter to the current image. Below you see the "Apply Texture" tool in action using this common dialog layout:

Example 3.2. The Apply Texture Tool in Action




  • (1): The seven buttons to the top left select the comparison style of the preview area. The modes are:

    • Original image

    • Split vertically without duplication. The left area shows the original whereas the right side shows the filter applied to the continuation of the selected zoom.

    • Split horizontally without duplication. The top area shows the original whereas the lower area shows the filter applied to the continuation of the selected zoom.

    • Split vertically. The left area shows the original and the right one the filter effect for comparison.

    • Split horizontally. The top area shows the original and the lower one the filter effect for comparison.

    • Effect preview. This is a live effect preview without comparison.

    • 'Mouse over' style: preview when mouse is off the preview (in the settings area), otherwise shows original.

  • (2): There are two buttons that can be toggled to show over or underexposure. The colors can be customized in the general setup page.

  • (3): The preview selector frame. Click and drag with the mouse on the floating frame to move it on the image. The preview area on the left of dialog is updated accordingly.

  • (4): The filter or plugin settings area.

  • (5): At the lower left corner: there is help and a reset to defaults button (all settings are remembered from the last use of the plugin).

  • (6): There is a progress indicator for plugins with involved calculations.

Processing RAW image files, RAW work-flow

A typical RAW workflow with digiKam may follow these steps:

  • Setting up the RAW conversion and color management preferences

    • get the ICC color profiles for the camera, display and printer

    • setup digiKam correctly defining a color work space

  • Camera whitepoint setting

  • Demosaicing (includes interpolation, noise filtering and chromatic aberration correction)

  • Conversion to a color space

  • Gamma correction, tone mapping

  • Color profile assignment

  • Dynamic range expansion (optional)

  • Continue with standard workflow

From there everything is simple, select a RAW image and open it in the editor. The color management widget will be displayed after the image has been processed in order to adjust color rendering. Without color management all images are very dark, this is normal. You can experiment the various profiles you have in order to select the best input profile according to your image (some tends to be very neutral, even a bit dull, some gives more saturated results, etc.).

Color editing tools

Auto-Correction Tools

Gilles Caulier

Gerhard Kulzer

This tool set provides five automatic correction levels that will improve an image in most cases. Use this tool before going into the more involved manual adjustments.

The Normalize, Equalize, Auto Levels, and Stretch Contrast available from CorrectAuto-Correction menu entry menu will attempt to work out the best color levels automatically. You will need to experiment with the effects of these functions to see what works best with your photograph.

  • Normalize: this method scales brightness values across the selected image so that the darkest point becomes black, and the brightest point becomes as bright as possible without altering its hue. This is often a "magic fix" for images that are dim or washed out.

    Example 3.3. Normalize Colors Correction Preview




  • Equalize: this method adjusts the brightness of colors across the selected image so that the histogram for the Value channel is as flat as possible, that is, so that each possible brightness value appears at about the same number of pixels as each other value. Sometimes Equalize works wonderfully at enhancing the contrasts of an image. Other times it gives garbage. It is a very powerful operation, which can either work miracles on an image or destroy it.

    Example 3.4. Equalize Colors Correction Preview




  • Auto-levels: this method maximizes the tonal range in the Red, Green, and Blue channels. It determines the image shadow and highlight limit values and adjust the Red, Green, and Blue channels to a full histogram range.

    Example 3.5. Auto Levels Correction Preview




  • Stretch Contrast: this method enhances the contrast and brightness of the RGB values of an image by stretching the lowest and highest values to their fullest range, adjusting everything in between. This is noticeable only with washed-out images and can be a good fix-it tool for bad photographs.

    Example 3.6. Stretch Contrast Correction




The results of any adjustments you make will not be remembered until you save your photograph.

White Balance

Gilles Caulier

Gerhard Kulzer

The digiKam White Balance is a semi-automatic tool to adjust the white-balance of a photograph.

White Balance setting is a common hurdle for digital still cameras. In the 'good old time' of film rolls, the white balance was done by the photolab. Nowadays the poor little camera has to guess what is white and what is black. Most of the time, what the camera chooses as the white point, is not of the correct shade or hue. Using this tool it is easy to correct this problem. It provides a variety of parameters that can be trimmed to obtain a better result.

Note

The whitebalance correction is somewhat limited by the fact that we operate in 8bit per channel color space. So if you depart too much from the original, over exposure zones may appear. If you can adjust the whitebalance in raw conversion mode (which is done in 16 bit space), the margin for correction will be greater.

This tool is based on a white color balance algorithm copyrighted by Pawel T. Jochym. Launch it from the ColorWhite Balance Image Editor menu.

Using the Whitebalance Tool

The White Balance Tool Dialog

The preview window can be resized. To the left, both an original and a target preview tab is shown. The target preview is updated dynamically according to the tool's settings. If you want to see the original whitebalance, just click on that tab.

The target photo preview has a red marker available. The luminosity value of the pixel under the marker is shown as a vertical line in the histogram .

To the top right, the widget displays a histogram that is dynamically updated when changing the parameters. This histogram is very instructive as it shows that even in well exposed photos, most of the pixels have very small luminosity. With a button you can select to show either one of the 3 colors (or the sum of it which is called luminosity).

With Exposure you can digitally change the original photo exposure. Increasing the exposure is has the risk of making the pixel noise more visible and to blow out the highlights. Check the Over exposure indicator at the lower right to see if you run into saturation problems. The Black Point adjustment can be used to cut the histogram from the left. If your photograph looks foggy (histogram has empty space on the left, black side), you probably need to use this option. The Exposure and Black Point adjustments can be automatically estimated by pressing the Auto Exposure Adjustments button. This sets the black point quite accurately.

The contrast of your output depends on Shadows, Saturation, and Gamma parameters. The Shadows adjustment lets you enhance or diminish the shadow details in your photo.

Increasing the contrast of your photograph can have the side effect of reducing the apparent Saturation of the photo. Use a value larger than 1 to increase the saturation and a value of less than 1 to desaturate the photo. A value of 0 will give you a black and white photo. Don't be shy to bump up the saturation of your photos a little. The general rule is that for higher Contrast (lower Gamma) you need to apply more Saturation.

The next set of options is the mainstay of White Balance settings, which controls the ratio between the three color channels. Here you can set the color Temperature, making your image warmer or colder. Higher temperature will result in a warmer tint. Setting the ratio between the three color channels requires two adjustments. Since the temperature adjustment mostly controls the ratio between the red and the blue channels, it is natural that the second adjustment will control the intensity of the Green channel.

Instead of fiddling around with the above controls, you can simply use the Temperature Tone Color Picker button. Press on this button and click anywhere on the original preview image to get the output color of that area to calculate the white color balance temperature settings. This way, Temperature and Green values are automatically computed.

In addition you can set the White Balance using the preset list. These are the white color balance temperature presets available:

Color TemperatureDescriptionKelvin
40W 40 Watt incandescent lamp. 2680
200W 200 Watt incandescent lamp, studio lights, photo floods. 3000
Sunrise Sunrise or sunset light. 3200
Tungsten Tungsten lamp or light at 1 hour from dusk or dawn. 3400
Neutral Neutral color temperature. 4750
Xenon Xenon lamp or light arc. 5000
Sun Sunny daylight around noon. 5500
Flash Electronic photo flash. 5600
Sky Overcast sky light. 6500

Color Temperature is a simplified way to characterize the spectral properties of a light source. While in reality the color of light is determined by how much each point on the spectral curve contributes to its output, the result can still be summarized on a linear scale. This value is useful e.g. for determining the correct white balance in digital photography, and for specifying the right light source types in architectural lighting design. Note, however, that light sources of the same color (metamers) can vary widely in the quality of light emitted.

Low Color Temperature implies more yellow-red light while high color temperature implies more blue light. Daylight has a rather low color temperature near dawn, and a higher one during the day. Therefore it can be useful to install an electrical lighting system that can supply cooler light to supplement daylight when needed, and fill in with warmer light at night. This also correlates with human feelings towards the warm colors of light coming from candles or an open fireplace at night. Standard unit for color temperature is Kelvin (K).

Over Exposure Indicator option adds up the colors if more than one channel in a pixel is over-exposed, and you will see the combined color resulting of White Color Balance controls settings. This rule is applied to target preview area as an indication only and has no effect on the final rendering.

Save As and Load buttons are used to do just that. Any White Color Balance settings that you have set can be saved to the filesystem in a text file and loaded later.

Reset All button resets all filter settings to default values corresponding to Neutral White Balance color. (Attention, even the neutral setting might be different from your original photograph. If you save it, the white balance will be changed.)

Encoding Depth

Here you can change the encoding depth per color channel of the edited image. 8 bit encoding is the common JPEG format, 16 bit encoding is better suited for high quality images, but this format needs more storage space, calculation time and is currently available with PNG, PNM, TIFF, and DNG formats only.

Color Management

This tool opens the same dialog as when editing RAW images. Its use is the change and assignment of color profiles. Tone mapping can also be done from the lightness adjustment tab (bottom tab). For detailed instructions on the use of color profiles, please refer to CM chapter.

Correcting Exposure

The simplest tool to use is the Brightness/Contrast/Gamma tool. It is also the least powerful, but in many cases it does everything you need. This tool is often useful for images that are overexposed or underexposed; it is not useful for correcting color casts. The tool gives you three sliders to adjust, for "Brightness", "Contrast" and "Gamma". You can see any adjustments you make reflected in the preview image. When you are happy with the results, press Ok and they will take effect.

Example 3.7. The Brightness Contrast Gamma Tool in Action




Another important tool is called ColorLevels Adjust. This tool provides an integrated way of seeing the results of adjusting multiple levels and also enables you to save level settings for application to multiple photographs. This can be useful if your camera or scanner often makes the same mistakes and you want to apply the same corrections. See the dedicated Adjust Levels manual for more information.

A very powerful way of correcting exposure problems is to use the Adjust Curves tool available by ColorCurves Adjust menu entry.

Solarize Image

Gerhard Kulzer

The digiKam Color Effectstool provides four color effects: a solarization effect, a velvia filter, neon effect and edge filter.

In the age of chemical image processing, solarizing (also known as Sabatier) was an effect created by exposing a partially developed print to a brief flash of light, then completing the development. The colored, darker areas shield the additional light from the sensitive photo layers, which has the net effect of making the lighter areas darker and colors being inverted during the second exposure. The result resembles a partially negative image. The tool allows to adjust the interesting effect smoothly.

Using Solarization

The Intensity control helps to preview the solarization by simply increasing it. At about 50% intensity the image shows what was once chemically possible. If you further increase the effect it will finally become a negative image, a stage of inversion not achievable on photographic paper.

Solarisation in action

This is an example of solarization effect. The original image is (1) and the corrected image is (2). The Intensity level applied is 30%.

Solarize Image Effect Preview

The Vivid Effect (Velvia filter)

The vivid filter simulates what is known as "Velvia" effect. It is different from saturation in that it has a more pronounced contrast effect that bring colors brilliantly alive and glowing. Try it, it renders beautiful for many subjects!

Velvia is a brand of daylight-balanced color reversal film produced by the Japanese company Fujifilm. The name is a contraction of "Velvet Media", a reference to its smooth image structure. Velvia has very saturated colors under daylight, high contrast. These characteristics make it the slide film of choice for most nature photographers. Velvia's highly saturated colors are, however, considered overdone by some photographers, especially those who don't primarily shoot landscapes.

Example 3.8. Original versus Vivid filter




The Neon Effect

The neon filter simulates neon light along the contrast edges. The level parameter controls the lightness of the result, whereas the interaction slider determines the thickness of the neon light. With big images, the filter might eat the CPU time for a moment.

Example 3.9. The neon filter




The Edge Effect

TODO

Correcting Color

Digital cameras often have problems with lighting conditions and it is not unusual to want to correct the color contrast and brightness of a photograph. You can experiment with altering the levels of different aspects of your photographs using the tools under the Color menu. You can see any adjustments you make reflected in the preview. When you are happy with the results, press Ok and they will take effect.

Example 3.10. The Color Balance Tool in Action




If your image is washed out (which can easily happen when you take images in bright light) try the Hue/Saturation/Lightness tool, which gives you three sliders to manipulate, for Hue, Saturation, and Lightness. Raising the saturation will probably make the image look better. In some cases, it is useful to adjust the lightness at the same time. ("Lightness" here is similar to "Brightness" in the Brightness/Contrast/Gamma tool, except that they are formed from different combinations of the red, green, and blue channels).

When you take images in low light conditions, you could get the opposite problem: too much saturation. In this case the Hue/Saturation tool is again a good one to use, only by reducing the saturation instead of increasing it. You can see any adjustments you make reflected in the preview image. When you are happy with the results, press Ok and they will take effect.

Example 3.11. The Hue Saturation Lightness Tool in Action




Adjust Levels

Gilles Caulier

Gerhard Kulzer

The digiKam Adjust Levels is a tool to manually adjust the histogram channels of an image.

Situated between the more sophisticated Adjust Curves tool and the simpler Brightness/Contrast/Gamma Image Editor tool is this Adjust Levels tool for improving exposure. Although the dialog for this tool looks very complicated, for the basic usage we have in mind here, the only part you need to deal with is the Input Levels area, concretely the 3 sliders that appear below the histogram.

This widget contains a visual graph of the intensity values of the active layer or selection (histogram). Below the graph are five sliders that can be clicked into and dragged to constrain and change the intensity level for the image. The left sliders position represents the dark areas and similarly, the right position represents the light areas.

Using the Adjust Levels tool

The Adjust Levels Tool Dialog

Actually the easiest way to learn how to use it is to experiment by moving the three sliders around, and watching how the image is affected.

On the right, both an original and a target preview image is available. The target preview is updated dynamically according to the slider positions. On the left, the following options are available:

  • Modify levels for Channel : this combo box allows the selection of the specific channel that will be modified by the tool:

    • Luminosity: this option makes intensity changes against all pixels in the image.

    • Red: this option makes Red saturation changes against all pixels in the image.

    • Green: this option makes Green saturation changes against all pixels in the image.

    • Blue: this option makes Blue saturation changes against all pixels in the image.

    • Alpha: this option makes transparency changes against all pixels in the image.

  • Set Scale for channel : this combo controls whether the histogram will be displayed using a linear or logarithmic amplitude. For images taken with a digital camera, the linear mode is usually the most useful. However, for images that contain substantial areas of constant color a linear histogram will often be dominated by a single bar. In this case a logarithmic histogram will often be more useful.

  • Input Levels: the input levels allow manual adjustments to be selected for each of the ranges. The main area is a graphic representation of image dark, mid and light tones content. They are on abscissa from level 0 (black) to level 255 (white). Pixel number for a level is on ordinate axis. The curve surface represents all the pixels of the image for the selected channel (histogram). A well balanced image is an image with levels (tones) distributed all over the whole range. An image with a predominant blue color, for example, will produce a histogram shifted to the left in Green and Red channels, manifested by green and red color lacking on highlights. The level ranges can be modified in three ways:

    • Three sliders: the first on the top for dark tones, the second one for light tones, and the last one on the bottom for midtones (often called Gamma value).

    • Three input boxes to enter values directly.

    • Three Color Picker buttons using the original photo preview to automatically adjust inputs levels settings for shadow, midtone and highlights. There is also a fully automated adjustment button available next to the reset button.

  • Output Levels: the output levels allow manual selection of a narrowed-down output level range. There are also two sliders located here that can be used to interactively change the output levels like Input Levels. This output level compression may, for example, be used to create a bleached image as a background for some other subject to put into the foreground.

  • Auto: this button performs an automatic setting of the levels based on the pixel intensities of the image.

  • Save As and Load: these buttons are used to do just that. Any Levels that you have set can be saved to the filesystem and loaded later. The used file format is The Gimp Levels format.

  • Reset All: this button reset all Input Levels and Output Levels values for all channels.

The Adjust Levels tool has several features to facilitate the positioning input levels sliders. Clicking the mouse button in the original image preview area produces a vertical doted bar in the graph area of the histogram. The bar position corresponds to the pixel value under the mouse cursor in the image window. Clicking and dragging the mouse button interactively updates the position of the vertical bar. In this way it is possible to see where different pixel values in the image are located on the input levels sliders and helps to discover the locations of shadow, midtone, and highlight pixels.

Using in this mode and the three Color Picker buttons will automatically adjust input levels settings in all channels for shadow, middle, and highlight tones. Enable the color picker button that you want use, and click on the original image preview area to set input levels on each of the Red, Green, Blue, and Luminosity histogram channels.

Over Exposure Indicator option checks all color channel to see if more than one channel in a pixel is over-exposed, and you will see the combined color resulting of channel level settings. This feature is available as an indicator in the target preview area and has no effect on final rendering.

The Adjust Levels tool in action

Below, you can see an Input levels adjustment example applied to a color image for the Red/Green/Blue channels. Intensity/Alpha channels and Output Levels are unchanged. The original image is (1), the corrected image (2).

The Adjust Levels Tool in Action

Adjust Curves

Gilles Caulier

Gerhard Kulzer

The digiKam Adjust Curves is a tool to non-linearly adjust luminosity graduation and color channels.

The Curves tool is the most sophisticated tool available to adjust the images' tonality. Start it from the ColorCurves Adjust Image Editor menu. It allows you to click and drag control points on a curve to create a free function mapping input brightness levels to output brightness levels. The Curves tool can replicate any effect you can achieve with Brightness/Contrast/Gamma or the Adjust Levels tool, though it is more powerful than either one of them. But this tool can do more for you, it helps you to improve the tonal quality of your photographs to very finely stepped gray scales. And do not forget that the better the photographs are (good exposure, lossless format, 24 or 32 bit deep) the more you can improve them. Navigate to the "Achieving ultimate tonal quality" section of this instructive page: Tonal quality and dynamic range in digital cameras by Norman Koren. Use Adjust Curves tool to do just the same!

This tool provides visual curves to modify the intensity values of the active layer displayed as a histogram non-linearily. In Smooth curve edition mode, you change the curves shape by adding new points to the curve or by moving end point positions. Another mode is to draw all the curve manually in Free curve edition mode. In both cases the effect is immediately displayed in the image preview area to the left, where the preview can be configured by clicking on the top left icons.

Using Adjust Curves

The Adjust Curves Tool Dialog

To the left, half of the original and the target preview image is shown. The target preview is updated dynamically according to the widget settings. On the right side the following options are available:

  • Modify Channel : with this combo box you can select the specific channel to be modified by the tool:

    • Luminosity: changes the intensity of all pixels.

    • Red: changes the Red saturation of all pixels.

    • Green: changes the Green saturation of all pixels .

    • Blue: changes the Blue saturation of all pixels.

    • Alpha: changes the transparency of all pixels.

  • Next to this box are two icons to select linear or logarithmic histogram display. For images taken with a digital camera the linear mode is usually the most useful. However, for images containing substantial areas of constant color, a linear histogram will often be dominated by a single bar. In this case a logarithmic histogram will be more appropriate.

  • Main Curves Editing Area: the horizontal bar (x-axis) represents input values (they are value levels from 0 to 255). The vertical bar (y-axis) is only a scale for output colors of the selected channel. The control curve is drawn on a grid and crosses the histogram diagonally. The pointer x/y position is permanently displayed above the grid. If you click on the curve, a control point is created. You can move it to bend the curve. If you click outside the curve, a control point is also created, and the curve includes it automatically. So each point of the curve represents an 'x' translated into a 'y' output level.

  • Curve Type for channel : below the editing area are several icons that determine whether the curve can be edited using a Smooth curve or a Free hand mode curve. Smooth mode constrains the curve type to a smooth line with tension and provides a realistic rendering. Free mode lets you draw your curve free-hand with the mouse. With curve segments scattered all over the grid, result will be surprising but hardly repeatable. A reset-to-defaults button is also available.

  • If, for example, you move a curve segment to the right, i.e. to highlights, you can see that these highlights are corresponding to darker output tones and that image pixels corresponding to this curve segment will go darker.

  • With color channels, moving right will decrease saturation up to reaching complementary color. To delete all control points (apart from both end points), click on the Reset Values button. To delete only one point, move it onto another point. Just ply with the curves and watch the results. You even can solarize the image on part of its tonal range. This happens when the curve is inverted in some part.

  • The original photo preview has a red marker on it. If you place this marker to a zone you want to modify, a corresponding line will be drawn on the curve grid indicating the original value. Create a point on that line and move it up or down to adjust it to your pleasing.

  • Save As and Load: these buttons are used to do just that. Any curves that you have set can be saved to the filesystem and loaded later. The used file format is The Gimp Curves format.

  • Reset All: this button resets all curve values for all channels.

The curves tool has several features that facilitate the positioning of points on the control curves. Clicking the mouse button in the original image preview area produces a vertical doted bar in the graph area of the curves tool. The bar position corresponds to the pixel value the mouse cursor is over in the image window. Clicking and dragging the mouse button interactively updates the position of the vertical bar. In this way, it is possible to see where different pixel values in the image are located on the control curve and helps to discover the locations of shadow, midtone, and highlight pixels.

Using this way and the three Color Picker buttons will automatically create control points on the curve in all channels for shadow, middle, and highlight tones. Enable the color picker button that you want to use, and click on the original image preview area to produce control points on each of the Red, Green, Blue, and Luminosity control curves.

Over Exposure Indicator option adds up all color channels and indicates the blown-out highlights. If more than one channel in a pixel is over-exposed you will see the combined color resulting from the curve settings. The display is an indicator only and has no effect on the final rendering.

The Adjust Curves in action

Below you can see a black and white photograph corrected in Luminosity channel. Shadow and highlight tone picker tool have been use to determined the curves to apply from original. The original image is (1), the corrected image (2).

The Adjust Curves Tool in Action

Channel Mixer

Gilles Caulier

Gerhard Kulzer

The digiKam image Channel Mixer is a tool to remix the color channels to improve or modify the photograph color shades.

The Channel Mixer is an another sophisticated tool to refine the images' tonality. Start it from the ColorChannel Mixer Image Editor menu.

Using the Channel Mixer

The Channel Mixer Tool Dialog

With the channel combo box you select and display the histogram per color. It gives a first hint of how to correct the channels by their relative distribution and amplitude. The left half of the dialog window always shows a preview of what you are doing. The original for comparison can be seen when selecting its own window tab.

The target photo preview has a red marker available. If you place this marker somewhere in the image, a corresponding vertical bar will be drawn in the histogram indicating the color level value in the current channel selected.

Now the controls are to the lower right: Red, Green and Blue slider controls enable you to mix the channels. If you check Preserve Luminosity the image will retain its overall luminosity despite you changing its color components. This feature is particularly useful when you also ticked the Monochrome box. Because the channel mixer is THE tool to make great black and white conversions of your photographs. Try to reduce the green channel for black and white portraits.

Note

Sometimes, especially when doing monochrome mixing, reducing one color channel may increase visible noise, which actually originates in the chroma noise. Chroma noise means that the little noise specs do not appear at the same location in all the color channels, but the noise patterns looks different in every channel. If that is the case you can improve the monochrome conversion by reducing the chroma noise first.

Save As and Load buttons are used to do just that. Any mixer settings that you have set can be saved to the filesystem and loaded later. The used file format is The Gimp channel mixer format.

Over Exposure Indicator option adds up the colors if more than one channel in a pixel is over-exposed, and you will see the combined color resulting of channel gain settings. This rule is applying to target preview area and haven't effect to final rendering.

Reset All button resets all channel mixer settings to default values.

The channel mixer in action

Below, you can see a photograph color tone adjustments for the Blue channel. Preserve luminosity option is on. The original image is (1), the corrected image (2).

The Channel Mixer in Action

Black and White Conversion Filters

Gilles Caulier

Gerhard Kulzer

Black & White photography has always been fascinating in its abstraction capability. With the advent of digital photography, B&W has almost become a desktop activity, as color images can be easily converted on the computer into black and white, even providing a set of vintage film roll profiles.

digiKam comes with a couple of black & white filters that you can use on your photographs. Under the FiltersBlack & White menu you will find classic black & white chemical toning used in analog photography. The controls come on three tabs: Film, Lens Filters, Tone and Lightness as shown on the screenshot below. Film, filters and color toning can be applied independently of each other (on top of each other). The filters actually influence the RGB channel mixing, whereas the toning purely adds a uniform monochromatic tint to the black & white photograph. In the lightness tab you will find a tonal adjustment tool (like curve adjust), a contrast tool and an over-exposure indicator to improve the b&w rendering.

Example 3.12. The Black & White Filter tool in Action




The table below shows in more detail the effect of all filters and tints.

PreviewPhotographic Film Emulation

Specific settings to emulate a number of famous black & white photographic films are available:

Agfa 200X, Agfa Pan 25, Agfa Pan 100, Agfa Pan 400

Ilford Delta 100, Ilford Delta 400, Ilford Delta 400 Pro 3200, Ilford FP4 Plus, Ilford HP5 Plus, Ilford PanF Plus, Ilford XP2 Super

Kodak Tmax 100, Kodak Tmax 400, Kodak TriX

PreviewLens Filter Type
Original color image taken in New Zealand landscapes.
Neutral: simulate black & white neutral film exposure.
Green Filter: simulates black & white film exposure with green lens filter. This comes good with all scenic images, especially suited for portraits taken against the sky (similar to 004 Cokin(tm) Green filter).
Orange Filter: simulates black & white film exposure with an orange lens filter. This will enhance landscapes, marine scenes and aerial photography (similar to 002 Cokin(tm) Orange filter).
Red Filter: simulates black & white film exposure with red lens filter. Creates dramatic sky effects and can simulate moonlight scenes in daytime (similar to 003 Cokin(tm) Red filter).
Yellow Filter: simulates black & white film exposure with yellow lens filter. Most natural tonal correction, improves contrast. Ideal for landscapes (similar to 001 Cokin(tm) Yellow filter).
PreviewColor Tint
Sepia Tone: gives a warm highlight and mid-tone while adding a bit of coolness to the shadows - very similar to the process of bleaching a print and re-developing in a sepia toner (typical for your grandmothers photographs). Similar to 005 Cokin(tm) Sepia filter.
Brown Tone: similar to Sepia Tone filter, but less pronounced.
Cold Tone: start subtle and replicate printing on a cold tone black & white paper such as a bromide enlarging paper.
Platinum Tone: effect that replicates traditional platinum chemical toning done in the darkroom.
Selenium Tone: effect that replicates traditional selenium chemical toning done in the darkroom.

Image enhancement

Image Sharpening

Gilles Caulier

Gerhard Kulzer

digiKam provides three different tools for sharpening, with each having merits in a different area.

  • Sharpen is a traditional sharpening tool, which is very fast and easy, but may quickly produce grainy images, in particular in dark areas.

  • Unsharp Mask works on the edge contrast to make an image appear sharper, but it actually does not sharpen at all, it works rather psychovisually. It can be used to remove atmospheric haze, and here it does a real good job. The algorithm was taken from the Gimp, and it is copyrighted by Winston Chang.

  • Refocus is probably the best of the three because it actually improves sharpness. It is a bit more involved in its application as is has several parameters to play with.

Out-of-focus photographs, as well as most digitized images, need correction of sharpness. This is due to the digitizing process that must chop up a color continuum in points with slightly different colors: elements thinner than sampling frequency will be averaged into an uniform color. Thus, sharp borders are rendered a little blurred. The same phenomenon appears when printing color dots on paper. SLR cameras need even more sharpening on a regular basis than consumer cameras.

Whereas JPEG images have some camera-internal sharpening applied, RAW format images always need sharpening in their workflow.

Some scanners apply a sharpen filter while scanning. It's worth to disable it so that you keep control over your image.

Adjusting Sharpness
Unblurring a Photograph

If the camera focus is not set perfectly or if the camera is moving when the image is taken the result is a blurred photograph. If there is a lot of blurring, you probably will not be able to do much about it with any technique. If there is only a moderate amount, you should be able to improve the image. Many good SLR cameras apply less image processing to the images than simpler cameras (which tend to artificially increase the contrast to make the images look crisp). This kind of slight blur can be easily improved with tools.

In some situations, you may be able to get useful results by sharpening an photograph using the Sharpen tool by the EnhanceSharpen menu entry.

Example 3.13. The Sharpen Tool in Action




You should be careful with this though, or the results will not look very natural: sharpening increases the apparent sharpness of edges in the photograph, but also amplifies noise. Generally, the most useful technique for sharpening a fuzzy photograph is the Refocus tool. You can access it with the EnhanceRefocus menu entry. Look at Refocus for more information and a comparison of all the sharpening techniques.

Reducing Graininess In a Photograph

When you take a photograph in low-light conditions or with a very fast exposure time, the camera does not get enough data to make good estimates of the true color at each pixel, and consequently the resulting photograph looks grainy. You can "smooth out" the graininess by blurring the image, but then you will also lose sharpness. Probably the best approach - if the graininess is not too bad - is to use the filter Noise Reduction tool, and you can access it by the EnhanceNoise Reduction menu entry.

Softening a Photograph

Sometimes you have the opposite problem: an image is too crisp. The solution is to blur it a bit: fortunately blurring an image is much easier than sharpening it. Select the Blur Tool with the EnhanceBlur menu entry and experiment with the level. The preview window on the right of the dialog shows the effect of the operation on your photograph.

The Unsharp Masking Filter

Note

The Unsharp Mask filter is an excellent tool to remove haze from your photographs, see this url for a demonstration.

Unsharp Mask Dialog

The image panel and the original preview help you to pan within the image. The preview window shows the filter output using the current settings.

There are two important parameters, Radius and Amount. The default values often work pretty well, so you should try them first. Increasing either the Radius or the Amount increases the strength of the effect. Don't get carried away, though: if you make the unsharp mask too strong, it will amplify noise in the image and create the impressions of ridges next to sharp edges.

The Radius allows you to set how many pixels on either side of an edge that will be affected by sharpening. High resolution images allow higher radius. You'd better always sharpen an image at its final resolution.

The Amount control is the percentage of the difference between the original and the blur image that is added back into the original. It allows you to set strength of sharpening.

The Threshold control is a fraction of the maximum RGB value, needed to apply the difference amount. It allows you to set the minimum difference in pixel values that indicates an edge where sharpening should be applied. That way, you can protect areas of smooth tonal transition from sharpening, and avoid creation of blemishes in face, sky or water surface.

The Unsharp Mask in action

This is an example of how the Unsharp Mask can change your life. The original image is (1) and the corrected image is (2). The unsharp mask was applied with Radius = 6.0, Amount = 0.5, Threshold = 0.0.

Unsharp Mask Tool in Action

Refocus a Photograph

digiKam The Refocus is a tool to refocus an image by enhancing the sharpness. It uses the Deconvolution Filter algorithm copyrighted by Ernst Lippe.

This tool attempts to "refocus" an image by undoing the defocussing. This is better than just trying to sharpen a photograph. It is employing a technique called FIR Wiener Filtering. The traditional technique for sharpening images is to use unsharp masking. Refocus generally produces better results than Unsharp masking. Start it from the EnhanceSharpenRefocus Image Editor menu.

The Refocus technique works differently from Unsharp Mask and is also unlike the Sharpen Filter which both increase the contrast of the edges of an image. Refocus rather reverses the process by which the image got blurred by the circular aperture of the camera. This method gives you as much of the original "in focus" image as possible. Refocus uses a very powerful deconvolution algorithm that will reclaim the data that has been mixed up. In mathematical terms, blurring is usually the result of a convolution, a deconvolution will reverse the process, this is exactly what Refocus is doing. Furthermore, the FIR filter technique allows to remove much of the noise and granularity that often gets accentuated in the sharpening process of all sharpening filters.

Using the Refocus Tool

Refocus Dialog

The image panel and the original preview help you to pan within the image. The preview window shows the filter output using the current settings.

In most cases (blurring by camera) a circular convolution caused the image degradation, but there are two convolutions available:

  • The circular convolution: this one spreads each source point uniformly across a small disk with a fixed radius. Technically this describes the effects of using a (ideal) lens that is not correctly focused.

  • The Gaussian convolution: this one is mathematically similar to the normal distribution, with its bell-shaped curve. Originates rather from unnatural blurring (software blurring). From a theoretical point of view the mathematical justification for using the Gaussian convolution is that when you a apply a large number of independent random convolutions the results will always approach a Gaussian convolution.

The refocus tool supports both the Circular and the Gaussian convolution plus mixtures of both.

In practice, in most cases the Circular convolution works much better than the Gaussian convolution. The Gaussian convolution has a very long tail, so mathematically the result of the convolution also depends on source pixels at a large distance from the original source pixel. The FIR Wiener inverse of a Gaussian convolution in most cases is heavily influenced by source pixels at a large distances, and in most cases this produces undesirable results.

To set correctly the deconvolution filter, the plug-in has the following parameters:

  • Circular Sharpness: This is the radius of the Circular convolution filter. It is the most important parameter for using the plug-in. With most images the default value of 1 should give good results. Select a higher value when your image is very blurred, but beware of producing halos.

  • Correlation: Increasing the Correlation may help reducing artifacts. The correlation can range from 0-1. Useful values are 0.5 and values close to 1, e.g. 0.95 and 0.99. Using a high value for the correlation will reduce the sharpening effect of the plug-in.

  • Noise filter: Increasing the Noise filter parameter helps reducing artifacts. The Noise can range from 0-1 but values higher than 0.1 are rarely helpful. When the Noise value is too low, e.g. 0 the image quality will be horrible. A useful value is 0.03. Using a high value for the Noise will even blur the image further.

  • Gaussian Sharpness: This is the radius for the Gaussian convolution filter. Use this parameter when your blurring is Gaussian (mostly due to previous blur filtering). In most cases you should leave this parameter to 0, because it causes nasty artifacts. When you use non-zero values you will probably have to increase the Correlation and/or Noise filter parameters, too.

  • Matrix size: This parameter determines the size of the transformation matrix. Increasing the Matrix Size may give better results, especially when you have chosen large values for Circular Sharpness or Gaussian Sharpness. Note that the plug-in will become very slow when you select large values for this parameter. In most cases you should select a value in the range 3-10.

  • Save As and Load: these buttons are used to do just that. Any Refocus parameters that you have set can be saved to the filesystem and loaded later.

  • Defaults: this button resets all settings to default values.

Below, you can see few hints to help you work with the refocus plug-in:

  • Preferrably perform all cropping, color and intensity curve corrections on the image before using this plug-in.

  • Otherwise use this plug-in before performing any other operations on the image. The reason is that many operations on the image will leave boundaries that are not immediately visible but that will leave nasty artifacts.

  • When you are scanning images and compress them, e.g. to JPEG, you should use the plug-in on the uncompressed image.

Refocus comparison with other techniques

Comparison to two other techniques frequently used to enhance images are:

Sharpening applies a small convolution matrix that increases the difference between a source pixel and its immediate neighbors. FIR Wiener filtering is a more general technique because it allows a much larger neighborhood and better parameterizations. Sharpening only works when your images are very slightly blurred. Furthermore, for high values of the sharpening parameter the results frequently looks "noisy". With FIR Wiener filtering this noise can be greatly reduced by selecting higher values for the Correlation and Noise filter parameters.

Unsharp masking is another very popular image enhancement technique. From a mathematical point of view its justification is a bit obscure but many people are very fond of it. The first step is to create a blurred copy of the source image. Then the difference between the source image and the blurred image is subtracted from the source image, hence the name unsharp masking. If fact, unsharp masking is more of a contrast enhancement on the important image feature than a sharpening. It does not undo the aperture pattern interference of the camera diaphragm as refocus does.

In general, unsharp masking produces better results than sharpening. This is probably caused by the fact that unsharp masking uses a larger neighborhood than sharpening.

From a theoretical point of view unsharp masking must always introduce artifacts. Even under optimal circumstances it can never completely undo the effect of blurring. For Wiener filtering it is possible to prove that it is the optimal linear filter. In practice, in all cases the results of the FIR Wiener filter were at least as good as those of unsharp masking. The FIR Wiener filter is frequently better in restoring small details.

Below, you can see a comparison of different filter apply on a small unfocused image:

PreviewType

Original blurred color image to fix. This image have been taken with an analog still camera. The unfocusing result of an insuffisant light for the auto-focus lens.

Fixed image using simple sharpening filter. Sharpness setting is 80.

Fixed image using unsharp mask filter. Settings are Radius=50, Amount = 5, and Threshold=0.

Fixed image using Refocus filter. Settings are Circular Sharpness=1.3, Correlation=0.5, Noise Filter=0.020, Gaussian Sharpness=0 and Matrix Size=5.

Note

For more information about correction of sharpness methods used in digital imagery, you can find a technical comparison at this url.

Remove Red Eyes in a Photograph

Red eyes are caused when the camera flashlight is used to take photographs of people. The red is the reflection from the back of the eye which can be seen because the pupil cannot react quickly enough to the flash. By the way, with a separate flash light the red eye effect is less likely because of the different viewing angle of flash and lens. You can correct some of the worst effect of Red Eye by selecting the area of the eye on the photograph, in the same way as described for cropping above. Then select EnhanceRed Eye Reduction.

How it works

  • Set the preview mode to your liking

  • The Sensitivity setting adjusts the amount of red eyes removal (agressive or not)

  • The Smooth slider sets the blurring of the area that has been darkened to render the pupil more natural

  • The Color Tint sets a custom colorization for the pupil. If you want blue eyes instead of dark ones, here you can do it

  • The Tint Level adjusts the luminosity of set pupil color

Example 3.14. The Red Eyes Correction Tool in Action




Photograph Inpainting

Gilles Caulier

Gerhard Kulzer

cimglogo

The Photograph Inpainting tool is definitely one of the most advanced tools to remove unwanted artifacts with unprecedented performance.

The inpainting algorithm has been developed by the IMAGE team of GREC CNRS lab in Caen/France and is a part of the CImg project.

Using the Inpainting tool

The Photograph Inpainting Dialog

The tool comes with several presets as starting points and to simplify the restoration. The preset settings available are listed below:

  • None: Using most common default filter settings not optimized for any particular purpose.

  • Remove Small Area: .

  • Remove Medium Area: .

  • Remove Large Area: .

If you want to set filter parameters for finer adjustments, use Smoothing Settings and Advanced Settings tabs:

The Inpainting Smoothing Settings

  • Detail Preservation p [0, 100]: this controls the preservation of the curvatures (features). A low value forces an equal smoothing across the image, whereas bigger values preferably smooth the homogeneous regions and leaves the details sharper. A value of 0.9 should well preserve details so that no sharpening is required afterwards. Note that Detail Preservation must be always inferior to Anisotropy.

  • Anisotropy alpha [0, 100]: a low value smooths equally in all directions, whereas a value close to 1 smooths in one direction only. If you have film grain or CCD kind of noise a high value will result in wave-like pattern, whereas JPEG artifacts are suited for values close to 1.

  • Smoothing [0, 500]: this sets the maximum overall smoothing factor (when p defines the relative smoothing). Set it according to the noise level.

  • Regularity [0, 100]: this parameter is concerned with the bigger structures. The bigger this value, the more even the overall smoothing will be. This is necessary when much noise is present since it is then difficult to estimate the geometry. Also if you want to achieve a 'van Gogh' turbulence effect, setting it higher than 3 is recommended.

  • Filter Iterations: number of times the blurring algorithm is applied. Usually 1 or 2 is sufficient.

The Inpainting Advanced Settings

  • Angular Step da [5, 90]: angular integration of the anisotropy alpha. If alpha is chosen small, da should also be chosen small. But beware, small angles result in long runs! Choose it as large as you can accept.

  • Integral Step [0.1, 10]: spatial integration step width in terms of pixels. Should remain less than 1 (sub-pixel smoothing) and never be higher than 2.

  • Use Linear Interpolation: The gain in quality if you select this option is only marginal and you lose a factor of 2 in speed. Our recommendation is to leave it off.

Save As and Load buttons are used to do just that. Any Photograph Inpainting filter settings that you have set can be saved to the filesystem in a text file and loaded later.

Warning

Photograph Inpainting is (comparatively) very fast in what it is doing, but it can take a long time to run and cause high CPU load. You may always abort computation by pressing Cancel button during rendering.

The Inpainting tool in action

Below, you can see a Remove Small Area Inpainting type applied to a color photograph taken at Guatemala city with an analog camera. Look like there is a strange black artifacts on the face front, resulting of a bad film stockage during the travel. The original image is (1), the corrected image (2).

The Inpainting Filter Preview

Noise Reduction

Gilles Caulier

Gerhard Kulzer

digiKam The Noise Reduction is a powerful tool to reduce the image noise. It uses an algorithm copyrighted by Peter Heckert.

This tool provides selectable image filters to remove specks or other artifacts caused by junk such as dust or hair on the lens. It also can be used to remove Sensor Noise from the camera that maybe caused by high ISO settings, as well as the so-called Moiré Patterns on scanned images from books or magazines.

If you want more information about what's digital camera sensor noise, please take a look in this tutorial.

Using the Noisereduction Tool

The Noise Reduction Dialog

The above screenshot shows a typical scene taken with an digital camera using a high sensitivity ISO setting. It shows grainy noise which can be reduced successfully with this tool.

The re-sizeable image panel with the original preview helps you to pan within the image. Move the red rectangle around to select the area that lets you judge on the optimal filter settings. The preview window shows the filter output using the current settings. It can be rearranged in four different combinations as depicted in the icons below the original preview. This screenshot shows the first arrangement where the same cutout is shown for comparison. On the bottom of preview area, you can see Zoom Factor settings to magnify an area of the image.

You can see below a full description of all parameters. In most cases only Details tab is needed and the other parameters available into Advanced tab can be left at their default setting.

  • Radius: this control selects the gliding window size used for the filter. Larger values do not increase the amount of time needed to filter each pixel in the image but can cause blurring. This window moves across the image, and the color in it is smoothed to remove imperfections. In any case it must be about the same size as noise granularity or somewhat more. If it is set higher than necessary, then it can cause unwanted blur.

  • Threshold: use the slider for coarse adjustment, and the spin control for fine adjustment. This controls edge detection sensitivity. This value should be set so that edges and details are clearly visible and noise is smoothed out. This value is not bound to any intensity value, it is bound to the second derivative of intensity values. Simply adjust it and watch the preview. Adjustment must be made carefully, because the gap between noisy, smooth, and blur is very small. Adjust it as carefully as you would adjust the focus of a camera.

  • Texture: this control set the texture accuracy. This value can be used, to get more or less texture accuracy. When decreased, then noise and texture are blurred out, when increased then texture is amplified, but also noise will increase. It has almost no effect to image edges, opposed to filter Edge, which would blur edges, when increased. If Edge is adjusted in away so that edges are sharp, and there is still too much area noise, then Texture detail could be used to reduce noise without blurring edges. Another way would be to decrease Radius and to increase Edge.

  • Sharpness: this control set the sharpness level. This value defines the pixel distance in which the filter looks ahead for luminance variations. When this value is increased, then spikenoise is erased. You can eventually readjust filter Edge, when you changed this setting. When this value is to high, then the adaptive filter cannot longer accurately track image details, and noise can reappear or blur can occur.

  • Edge: this control set the edge accuracy for sharpness. This value improves the frequency response for the filter. When it is too strong then not all noise can be removed, or spike noise may appear. Set it near to maximum, if you want to remove weak noise or JPEG-artifacts, without loosing detail.

  • Erosion: this control set the phase shift for edges. This value can be used to erodes singular spikes and it has a smooth effect to edges, and sharpens edges by erosion, so noise at edges is eroded. The effect is dependant from Sharpness, Damping, and Edges. Set it to minimum, if you want to remove weak noise or JPEG-artifacts. When this value is increased, then also increasing Damping is often useful. This setting can provides sharpening and antialiasing effect to edges when spike noise is corrected.

  • Luminance: this control set the luminance tolerance of image. It's recommended to use only Color or Luminance tolerance settings to make an image correction, not the both at the same time. This settings don't influence the main smoothing process controlled by Details settings.

  • Color: this control set the color tolerance of image. It's recommended to use only Color or Luminance tolerance settings to make an image correction, not the both at the same time. This settings don't influence the main smoothing process controlled by Details settings.

  • Gamma: this control set the gamma tolerance of image. This value can be used to increase the tolerance values for darker areas (which commonly are more noisy). This results in more blur for shadow areas.

  • Damping: this control set the phase jitter damping adjustment. This value defines how fast the adaptive filter-radius reacts to luminance variations. If increased, then edges appear smoother, if too high, then blur may occur. If at minimum then noise and phase jitter at edges can occur. It can suppress spike noise when increased and this is the preferred method to remove it.

  • Save As and Load: these buttons are used to do just that. Any Noise Reduction parameters that you have set can be saved to the filesystem and loaded later.

  • Defaults: this button resets all settings to default values.

Noisereduction in action

This is an example of how the noise reduction can change your life. The original image is (1) and the corrected image is (2). The noise reduction was applied using default settings.

The Noise Reduction in Action

Softening a Photograph

Sometimes an image is too crisp for your purposes. The solution is to blur it a bit: fortunately blurring an image is much easier than sharpening it. Select the Blur Tool with the EnhanceBlur menu entry and experiment with the level. The preview window on the right of the dialog shows the effect of the operation on your photograph.

Example 3.15. The Blur Tool in Action




Photograph Restoration

Gilles Caulier

Gerhard Kulzer

cimglogo

digiKam The Photograph Restoration is definitely one of the most advanced tools to reduce photograph artifacts.

This fantastic restoration filter is a new development providing unprecedented possibilities in the public domain to remove lots of unwanted stuff from your images. It is well adapted to deal with degraded images suffering from Gaussian noise, film grain, scratches or compression artifacts and local degradations usually encountered in digital (original or digitized) images. The smoothing happens along the image curvatures, thus preserving the meaningful content much alike our human eye would want it.

The same algorithm can be used for colorization and texture replacement which is covered by another tool (inpainting). The restoration algorithm has been developed by the IMAGE team of GREC CNRS lab in Caen/France and is a part of the CImg project.

Using the Restoration tool

Photograph Restoration Dialog

The tool comes with several presets as starting points and to simplify the restoration. The preset settings available are listed below:

  • None: Using most common default filter settings not optimized for any particular purpose.

  • Reduce Uniform Noise: Optimum settings for image noise due to sensors.

  • Reduce JPEG Artifacts: JPEG's compression is not perfect, in fact for some types of images it is far from it. As a lossy compression algorithm, there are some compression "artifacts" - slight defaults showing in the decompressed image. This setting aims at correcting this problem.

  • Reduce Texturing: Optimized to remove artifacts from scanning, digitizing or Moire patterns.

If you want to set filter parameters for finer adjustments, use Smoothing Settings and Advanced Settings tabs:

The Restoration Smoothing Settings

  • Detail Preservation p [0, 100]: this controls the preservation of the curvatures (features). A low value forces an equal smoothing across the image, whereas bigger values preferably smooth the homogeneous regions and leaves the details sharper. A value of 0.9 should well preserve details so that no sharpening is required afterwards. Note that Detail Preservation must be always inferior to Anisotropy.

  • Anisotropy alpha [0, 100]: a low value smooths equally in all directions, whereas a value close to 1 smooths in one direction only. If you have film grain or CCD kind of noise a high value will result in wave-like pattern, whereas JPEG artifacts are suited for values close to 1.

  • Smoothing [0, 500]: this sets the maximum overall smoothing factor (when p defines the relative smoothing). Set it according to the noise level.

  • Regularity [0, 100]: this parameter is concerned with the uniformity of the smoothing. Imagine the smoothing process as a combing of the image. Then the Regularity would correspond to the size of the comb. The bigger this value, the more even the overall smoothing will be. This is necessary when much noise is present since it is then difficult to estimate the local geometry. Also if you want to achieve a 'van Gogh' turbulence effect, setting it higher than 3 is recommended.

  • Filter Iterations: number of times the blurring algorithm is applied. Usually 1 or 2 is sufficient.

The Restoration Advanced Settings

  • Angular Step da [5, 90]: angular integration of the anisotropy alpha. If alpha is chosen small, da should also be chosen small. But beware, small angles result in long runs! Choose it as large as you can accept.

  • Integral Step [0.1, 10]: spatial integration step width in terms of pixels. Should remain less than 1 (sub-pixel smoothing) and never be higher than 2.

  • Use Linear Interpolation: The gain in quality if you select this option is only marginal and you lose a factor of 2 in speed. Our recommendation is to leave it off.

Save As and Load buttons are used to do just that. Any Photograph Restoration filter settings that you have set can be saved to the filesystem in a text file and loaded later.

Warning

Photograph restoration is (comparatively) very fast in what it is doing, but it can take a long time to run and cause high CPU load. You may always abort computation by pressing Abort button during preview rendering.

The Restoration tool in action

Below, you can see a Reduce Uniform Noise Restoration type applied to a Black and White photograph taken with a Minolta(tm) 700Si camera using Ilford(tm) HP-5 film set at 3200 ISO sensitivity. You see the very prominent film grain on the faces. The original image is (1), the corrected image (2).

Reduce Uniform Noise Restoration Preview

Below, you can see an another Photograph Restoration example using Reduce Texturing Restoration type applied to an old color photograph acquire with a digital flat scanner. You see the very prominent artifacts resulting of scanner light on plastic photograph paper. The original image is (1), the corrected image (2).

Reduce Texturing Restoration Preview

Hot Pixels Correction

Gilles Caulier

Unai Garro

digiKam The Hot Pixels tool facilitates removing hot pixels from photographs taken with a CCD camera. It uses algorithms from the JPEGPixi project which are copyrighted by Martin Dickopp.

Most current digital cameras produce images with several brightly colored "bad pixels" when using slow shutter speeds. Night images can be ruined by these "bad pixels". There are three different types of "bad pixels":

  • Stuck pixels: it's a pixel that always reads high or is always on to maximum power on all exposures. This produces a bright pixel usually of red, blue or green color in the final image. A stuck pixel will occur regardless of shutter speed, aperture size or any other user settings. It will occur on a normal exposure and tends to be more obvious under bright condition.

  • Dead pixels: it's a pixel that reads zero or is always off on all exposures. This state produces a black pixel in the final image. Similar to stuck pixel, a dead pixel will occur regardless of shutter speed, aperture size or any other user settings.

  • Hot pixels: it's a pixel that reads high (bright) on longer exposures as white, red, or green color. The longer the exposure time, the more visible hot pixels will become. These pixels will not be visible in bright conditions.

Note that stuck or dead pixels will occur at the same location for all images. If the location of the stuck or dead pixel occurs at different locations, it may be a Hot Pixel.

Stuck, dead or hot pixels are a problem in particular when shooting in high quality raw mode since many cameras have built-in hot pixel suppression applied automatically when JPEG compression is used (which is mostly the case).

This tool can be used to fix the "Hot pixels" and "Stuck Pixels" on a photograph using a black frame subtraction method. There is no yet a manual editor to select bad pixels.

Create the Black Frames

The Black Frame substraction method is the most accurate "Hot Pixels" and "Stuck Pixels" removal. First you have to create a "Black Frame" as a reference. This is easy to do. When you finish taking your long exposure shots, put a lens cap on the camera and take one "dark" image with the same exposure time as the images before. This image will be all dark, but with close examination you will see that it has the Hot and Stuck Pixels (colored dots). These are positioned at the same places as on your previous shots.

Load this file to the widget using the Black Frame button. The toll will process an automatic detection of Hot and Stuck Pixels. They will be highlighted in the control panel preview areas.

Warning

If you use an old digital camera, it is important to re-shoot the Black Frame next time you are taking a long exposure images to detect new Hot and Stuck Pixels on CCD defects.

Using the hotpixel tool

The Hot Pixels Dialog

At first, as explained in the previous section, you need to load a Black Frame corresponding to the image to correct. An automatic parsing will be processed on the Black Frame to find bad pixels. Note that the widget will remember the previous Black Frame used on the last session and it will be re-opened automatically with the next session.

The image panel and the original preview help you to pan within the image. The preview window shows the filter output using the current settings. Bad Pixels are highlighted on all preview areas.

Select an area to see bad pixels on preview and the filter result using 'Separate View' options of image panel. Choose the best Filter method to interpolate pixels or pixel blocks. These are the available filters:

  • Average: the pixels adjacent to the pixel block are averaged. The resulting color is assigned to all pixels in the block. For 1-dimensional interpolation, this is done separately for one pixel-wide, horizontal or vertical stripes.

  • Linear: the pixels which have a distance of 1 from the pixel block are used to calculate a bi-linear surface (2-dim), or a group of linear curves (1-dim), which is then used to assign interpolated colors to the pixels in the block.

  • Quadratic: this is the default filtering method. The pixels which have a distance of 2 or less from the pixel block are used to calculate a bi-quadratic surface (2-dim), or a group of quadratic curves (1-dim), which is then used to assign interpolated colors to the pixels in the block.

  • Cubic: the pixels which have a distance of 3 or less from the pixel block are used to calculate a bi-cubic surface (2-dim), or a group of cubic curves (1-dim), which is then used to assign interpolated colors to the pixels in the block.

The hotpixels tool in action

Below, you can see the Hot Pixels Correction tool applied to a color photograph taken with a deficient digital camera at 200 ISO sensitivity with a long exposure shot. The original image magnified to 300% is (1), the corrected image (2).

The Pixels Correction Preview

Vignetting Correction

Gilles Caulier

Gerhard Kulzer

digiKam The Vignetting correction is a tool to correct image vignetting (under-exposure in the corners).

Wide angle lenses, especially those used in medium and large format photography, frequently do not uniformly illuminate the entire sensor plane. Instead, they "vignette" (shade) the edges and corners of the image, substantially reducing the light reaching the sensor there. But telelenses may show vignetting too.

The traditional solution for this is to attach a "center filter" to the lens. This is a neutral density filter with maximum density at the optical axis of the lens, clear at the periphery, with density varying inversely to the vignetting of the lens. A center filter has many advantages: not only does it automatically correct for full-frame images but, since it's fixed to the front of the lens, it also compensates for the off-center vignetting which occurs when camera movements are employed for perspective or plane of focus adjustment.

But there are disadvantages as well. Many center filters require a 1.5 or 2 f-stop filter factor adjustment, which may in turn necessitate a shutter speed so slow (since wide angle lenses, even with center filters, are best used at apertures of f/16 or smaller) that hand-holding the camera is impossible and motion blur becomes a problem when photographing moving objects.

With the wide exposure range of present-day film and the color (or grey-scale) depth of digital camera or film scanners, it is possible to simulate the effect of a center filter by applying an equivalent transform to a raw image taken without the filter. This antivignetting tool applies a center filter transformation to an image employing an algorithm copyrighted by John Walker.

Using the vignetting correction tool

The Vignetting Correction Dialog

Five sliders give you control over the vignetting correction filter, and three more over the target image exposure:

Amount: this option controls the degree of luminosity attenuation by the filter at its point of maximum amount. The default amount is 2.0, which corresponds to an optical filter with a 1 f-stop filter factor (or, by no coincidence, a factor of 2 in luminosity). Increase the amount to compensate for a greater degree of vignetting; reduce it for less.

Feather: this option determines the rate at which the filter intensity falls off from the point of maximum amount toward the edges, expressed as a power factor. The default of 1 yields a linear reduction in filter amount with distance from the center. Power factors greater than 1.0 cause a faster fall-off (for example, a power of 2 causes the amount to decrease as the square of the distance from the center) and causes the effect of the filter to be concentrated near the center. Powers less than 1 spread out the amount of the filter toward the edges; a power of 0.5 causes the amount to fall as the square root of the distance from the center.

Radius: this option specifies the radius, as a multiple of the half diagonal measure of the image, at which the amount of the filter falls off to zero (or, in other words, becomes transparent). The default value of 1.0 specifies a filter which is transparent at its corners. A radius specification greater than 1 extends the effect of the center filter beyond the edges of the image, while a radius less than one limits the filter's action to a region smaller than the image. When compensating for vignetting by lenses used with large format and some medium format cameras, the default radius factor of 1 is rarely correct! These lenses often "cover" an image circle substantially larger than the film to permit camera movements to control perspective and focus, and consequently have a vignetting pattern which extends well beyond the edges of the film, requiring a radius setting greater than 1 to simulate a center filter covering the entire image circle.

The only way to be sure which settings of Amount, Feather, and Radius best compensate for the actual optical characteristics of a given lens is to expose a uniformly illuminated scene (for example, a grey card lit by diffuse light) and perform densitometry on the resulting image (for example with Adjust Level tool histogram position bar). Failing that, or specifications by the lens manufacturer giving the precise degree of vignetting at one or more working apertures, you may have to experiment with different settings to find those which work best for each of your lenses. For help you in this task, the widget dialog provide a thumbnail mask rendering applied on the image. Fortunately, the response of the human eye is logarithmic, not linear like most digital imaging sensors, so you needn't precisely compensate for the actual vignetting to create images which viewers will perceive as uniformly illuminated.

X offset and Y offset settings: these options moves respectively the center of the filter horizontally or vertically up to the border of the image by the specified percentage. A negative value for the X offset will shift the filter to the left while a positive value will shift it to the right. A negative value for the Y offset will move the filter up, and finally a positive value will move it down.

Brightness, Contrast, and Gamma settings: processing an image with this antivignetting tool reduces the luminosity of pixels. You need to re-adjust the target image exposure with these options. These sliders give only positive values because you need only to increase this setting.

Add Vignetting: many photographs looks flat because of a distracting background or another composition matter. While most of time you will want to remove vignetting it is a fact that a selective vignetting could improve the readability of a photograph and draw the eyes to the intended subject. As an artist you may choose this option, ticking it will invert the filter thus darkening the corners of a photograph.

Note

digiKam If you want a finer exposure re-adjustment of the target image, leave the Brightness/Contrast/Gamma values at zero and use the Adjust Curve tool from Image Editor available under ColorAdjust Curve menu entry.

The vignetting correction tool in action

This is an example of an anti vignetting correction applied to an image. The original image (1) shows vignetting in the corners, the corrected image (2) much less. A brightness and contrast correction is also applied to the target image by this tool.

The values used for this example are:

  • Density = 2.6.

  • Power = 0.9.

  • Radius = 1.1.

  • Brightness = 20.

  • Contrast = 50.

  • Gamma = 20.

The Vignetting Correction Image Editor Tool in Action

Lens Distortion Correction

Gilles Caulier

Gerhard Kulzer

digiKam The Lens Distortion is a tool to correct spherical lens aberrations on the photos. It uses an algorithm copyrighted by David Hodson.

Barrel distortion is associated with wide angle (or minimal zoom) lenses. It causes the images to appear slightly spherical (curved outward) like a barrel. You can notice this when you have straight features close to the image's peripheral sides. Pincushion distortion is the opposite defect and is associated with Telephoto lenses (maximum zoom) or underwater images. The images appear pinched (bent inward) toward the center. The Pincushion is often less noticeable than barrel but are equally visible near the edges. These distortions can easily be eliminated without visible loss in quality with this tool.

Note

This tool treats the geometrical distortions. Chromatic aberrations will not be corrected by this tool.

The following figures explain the main types of geometrical distortions:

  • (1): pincushion distortion.

  • (2): no distortion.

  • (3): barrel distortion.

Lens Distortion Types

Using the lens distortion tool

Note

A bit of explanation first. The geometrical corrections use 4th-order polynomial coefficients.

  • The 1st-order coefficient changes the size of the image. The tool calls this Zoom.

  • The 2nd-order coefficient treats the main geometrical distortion of lenses and can correct the convex or concave shape of the image.

  • The 3rd-order coefficient has a similar rounding effect but levels off towards the edges. This correction is not employed in the tool.

  • The 4th-order coefficient corrects the far edges inversely to the 2nd-order rounding. Combining it with the 2nd-order correction the geometrical distortions can be almost completely eliminated.

Lens Distortion Correction Dialog

Four sliders let you set the distortion correction filter:

Main: this value controls the amount of 2nd-order distortion. Negative values correct barrel distortions, while positive values correct pincushion distortion.

Edge: this value controls the amount of 4th-order distortion. The Edge control has more effect at the edges of the image than at the center. For most lenses, the Edge parameter has the opposite sign of the Main parameter.

Zoom: this value rescales the overall image size (1st-order correction). Negative values zoom out of the image, while positive values zoom in.

Brighten: this control adjusts the brightness in image corners. Negative values decrease the brightness image corners, while positive values increase it.

To help you to choose the best filter settings, the widget dialog illustrates with a thumbnail preview the distortion correction applied to a crossed mesh pattern. The values you apply to your image will be saved and come up with the same values as default the next time you call the tool.

Note

The barrel-pincushion correction should be done before any crop or size changes (including perspective correction). In fact the Barrel-Pincushion corrections should be the very first step on the original image. If you crop the image and then use barrel correction the effect would be obviously wrong.

To help you finding the best correction the tool provides a vertical and horizontal guide. Move the mouse cursor in the image preview to display the dashed lines guide. Move the cursor to an important place in the image like the sea level or a building border and press the left mouse button for freeze the dashed lines position. Now, adjust the barrel/pincushion correction to align with the guide.

When using pincushion correction the resulting image will have a black border in the corner. You will need to cut this out with a crop tool available in TransformCrop Image Editor menu or via the zoom slider of this dialog.

On most images using the barrel correction is enough, however with some shots such as front images, frames, paintings, the next logical step is to use perspective correction to make all the angles 90 degrees. Note that when you hold your camera by hand you almost always introduce some kind of slight perspective distortion.

The lens distortion tool in action

This is an example of a barrel correction applied to church in north Norway. The original image is (1), the corrected image (2).

The values used for this example are:

  • Main = -40.

  • Edge = 0.

  • Zoom = -20.

  • Brighten = 0.

Lens Distortion Correction Preview

Image transformation tools

Rotating or Flipping a Photograph

If the photograph shows a wrong orientation you can Flip or Rotate it to the orientation you would like by using Transform Flip/Rotate tools available in TransformRotate and TransformFlip menus.

With flipping options, you can flip or turn over the image horizontally or vertically like a card deck. With the rotating options, you can rotate the image in 90 degrees steps clockwise. It can be used to change the display mode to Portrait or Landscape. Be aware that this rotation is not lossless when using JPEG format. You also can rotate more accurately to a finer degree by using the Free Rotation tool. You can access it by the TransformFree Rotation menu entry. See the dedicated Free Rotation manual for more information.

Change the image size

Gilles Caulier

Gerhard Kulzer

cimglogo

The digiKam Blowup Photograph is definitely one of the most advanced tools to increase a photograph's size with minimal loss in image quality.

Rescaling an image to make it smaller is easy. The big question is: how can you blow up an image and keep the details sharp? How can one zoom in when the resolution boundary has been reached? How can one reinvent or guess the missing information to fill in the necessarily coarse image after upsizing? Well, the CImg algorithm we use here does an excellent job, try it out and see for yourself!

Resizing a Photograph

If the photograph has the wrong size, you can scale it to the size you would like by using Transform Resize tool. Select TransformResize and adjust the target values. The Resize tool dialog is available below.

Example 3.16. The Resize Tool Dialog




This image resizing tool uses a standard linear interpolation method to approximate pixels. If you want to up-size a small image with a better quality, try the Blowup tool.

Increasing image size (blow-up)

Many image editing programs use some kind of interpolation e.g. spline interpolation to scale-up an image. digiKam uses a more sophisticated approach. The algorithm underlying Blowup Photograph has been developed by the IMAGE team of GREC CNRS lab in Caen/France and is a part of the CImg project.

Blowup Photograph Dialog

You have to tell the tool about the resizing you want to do. These settings are available in New Size tab and are listed below:

  • Maintain Aspect Ratio: if this option is enabled, setting the new image size will preserve the aspect ratio of the original image.

  • Width: the new image width to use for blowing up.

  • Height: the new image height to use for blowing up.

If you want to set filter parameters for finer adjustments, use Smoothing Settings and Advanced Settings tabs:

Photograph Blowup Smoothing Settings

  • Detail Preservation p [0, 100]: this controls the preservation of the curvatures (features). A low value forces an equal smoothing across the image, whereas bigger values preferably smooth the homogeneous regions and leaves the details sharper. A value of 0.9 should well preserve details so that no sharpening is required afterwards. Note that Detail Preservation must be always inferior to Anisotropy.

  • Anisotropy alpha [0, 100]: a low value smooths equally in all directions, whereas a value close to 1 smooths in one direction only. If you have film grain or CCD kind of noise a high value will result in wave-like pattern, whereas JPEG artifacts are suited for values close to 1.

  • Smoothing [0, 500]: this sets the maximum overall smoothing factor (when p defines the relative smoothing). Set it according to the noise level.

  • Regularity [0, 100]: this parameter is concerned with the bigger structures. The bigger this value, the more even the overall smoothing will be. This is necessary when much noise is present since it is then difficult to estimate the geometry. Also if you want to achieve a 'van Gogh' turbulence effect, setting it higher than 3 is recommended.

  • Filter Iterations: number of times the blurring algorithm is applied. Usually 1 or 2 is sufficient.

Photograph Blowup Advanced Settings

  • Angular Step da [5, 90]: angular integration of the anisotropy alpha. If alpha is chosen small, da should also be chosen small. But beware, small angles result in long runs! Choose it as large as you can accept.

  • Integral Step [0.1, 10]: spatial integration step width in terms of pixels. Should remain less than 1 (sub-pixel smoothing) and never be higher than 2.

  • Use Linear Interpolation: The gain in quality if you select this option is only marginal and you lose a factor of 2 in speed. Our recommendation is to leave it off.

Save As and Load buttons are used to do just that. Any Blowup Photograph filter settings that you have set can be saved to the filesystem in a text file and loaded later.

Warning

Blowup Photograph is very fast in what it is doing, but it can take a long time to run and cause high CPU load. You may always abort computation by pressing Cancel button during rendering.

The blow-up tool in action

You can see below an Blowup Photograph example applied to a small color image area resized to x2. The original is (1), the Blowup result (3). The (2) preview is the result given to standard linear resizing method to compare.

Blowup Photograph Filter Preview

Cropping a Photograph

Manual Crop

Cropping a photograph is not only a common operation, but an often underestimated photographer's tool to compose an image. The Image Editor makes it very easy. To crop a photograph simply drag a rectangle over the image by holding down the left mouse button and moving the mouse. You will see a wire frame rectangle appear as you move the mouse.

Example 3.17. The Current Image Selection in Image Editor




When you release the button the area of the photograph that will be removed by a crop operation is greyed out. This allows you to get a good view of how your photograph will look once you have cropped it. You can change the size of the cropped area by dragging the corners of the rectangle, and you can create a new crop area simply by dragging out another rectangle.

Once you are happy with the crop, click on the The Image Editor Crop Button button on the toolbar and the photograph will be cropped (Ctrl+X). Use the FileSave or FileSave As entries in the File menu to save the newly cropped photograph.

Proportional Crop

The Aspect Ratio Crop tool goes further. While you are editing digital images, it is often necessary to create a compatible format with, for example, your photo album or paper formats. If you print an image from your digital camera and then try to put it in your photo album, you may notice that the camera has a different width or height ratio than a normal photographic film format so you need to crop your digital images in a predefined ratio (for example 5:7 or 2:3 which is a standard photo ratio).

Example 3.18. The Aspect Ratio Crop Tool Dialog




In the preview area you can resize the cropping rectangle by moving the corners with the mouse. It will keep the ratio value set in the bottom of dialog.

In the Aspect Ratio Crop tool settings, you specify the Orientation as Portrait or Landscape. Portrait will always have the larger size assigned to the Height and Landscape to the Width.

Aspect Ratio Crop tool uses a relative ratio. That means it is the same if you use centimeters or inches and it doesn't specify the physical size. For example, you can see below a correspondence list of traditional photographic paper sizes and aspect ratio crop.

Standard Photograph Paper SizeAspect Ratio Crop
10x15cm 20x30cm 30x45cm 3.5x5" 4x6" 8x12" 12x18" 16x24" 20x30" 2:3
6x8cm 15x20cm 18x24cm 30x40cm 3.75x5" 4.5x6" 6x8" 7.5x10" 9x12" 3:4
20x25cm 40x50cm 8x10" 16x20" 4:5
15x21cm 30x42cm 5x7" 5:7
21x30cm 42x60cm 7:10

At the far right of the dialog two buttons are available to move the crop selection automatically to the horizontal or vertical center of the image.

At the very bottom line of the dialog, the Max. Ratio button lets you set the crop area size to the maximum size according to the current aspect ratio settings and orientation.

Note

The Aspect Ratio Crop tool remembers the settings depending on image orientation (horizontal or vertical). When you use the crop tool next time, these settings will be used as default values depending on the image orientation. The changed image dimensions are stored into the EXIF tables so that the EXIF data reflects the cropped image and not the original one.

Composition Guide

When first looking at an image, the eye of the viewer rarely settles at the center of the image, but moves instead from the top left to the right, and then from the lower left to the right again. This pattern is unconscious but has been well documented. It is probably associated with the western reading pattern. From the photographer's point of view, the goal then becomes to guide the gaze of the viewer to the subject, being aware of the way many people perceive an image.

The Composition Guide settings provides guiding elements to better compose your images. These guides are:

  • Rule of Thirds: a grid that divides the image into thirds in every direction (that makes for 9 parts). These proportions are close to the golden rule and are derived from the field of view of the human eye. They are often used with slight variations throughout a large number of commonly used objects. Within that frame there are precise areas where the important parts of the image should be placed. The same principle is used to determine the position of the horizon and the proportion of ground to sky.

    Many photographers and artists are aware of the Rule of Thirds, where an image is divided into three sections vertically and horizontally and the points of intersection represent places to position important visual elements. Moving a horizon in a landscape to the position of one third is often more effective than placing it in the middle, but it could also be placed near the bottom one quarter or sixth. There is nothing obligatory about applying the Rule of Thirds. In placing visual elements for effective composition, one must assess many factors including color, dominance, size and balance together with proportion. Often a certain amount of image balance or tension can make a composition more effective.

    Example 3.19. Image Composition Example Using Rules of Third




  • Harmonious Triangles: Harmonious divisions rely on the principle of similarity. Like the Rule of Thirds guide, Harmonious Triangles are another division of the image using a rectangle into equiangular harmonious triangles aligned with the diagonal.

    Example 3.20. Photograph Composition Example Using Harmonious Triangles




  • Golden Mean: The Golden Mean is a ratio underlying numerous growth patterns throughout nature (from the spiral of a Nautilus shell to the petals of a sunflower), it has an uncanny way of showing up in all kinds of things we deem beautiful.

    The Golden Ratio is the irrational number 1.618033988..., and it is usage dates back to the ancient Egyptians and Greeks who used it in the construction of their temples and pyramids. Artists and architects throughout time have used the Golden Ratio when composing their paintings, buildings, and even photographs, in order to give their creations a sense of natural order and beauty.

    The ratio is inherent in the Fibonacci series: 1, 1, 2, 3, 5, 8, 13, 21, 34 etc.., where each succeeding number after 1 is equal to the sum of the two preceding numbers. The ratio formed 1:1.618 is the Golden Mean. A composition following this rule is considered visually harmonious.

    The Golden Mean provides more fluid guidelines when used to compose an image. These guides are listed below:

    • The Golden Spiral guide will increase your odds of getting captivating results in your photographs. As opposed to Rule of Thirds, the Golden Spiral forms a fluid line for the eye to trace through the image. This style of composition will invite the viewer's gaze into the image along the line of the spiral, creating a more symmetrical visual flow, and an overall compelling viewing experience.

      Example 3.21. Image Composition example using Golden Spiral




    • One more rule is a Golden Spiral Sections (or Golden Rectangles). These rectangles are used to build the Golden Spiral. There should be something leading the eye to the center of the composition. It could be a line or several subjects. This "something" could just be there without leading the eyes, but it would make its job.

      Example 3.22. Image Composition example using Golden Spiral Sections




    • The Golden Triangles is a derivative of the Golden Spiral discussed above. Its vertices are the midpoints of the sides of the Golden Rectangle. Note that unlike Harmonious Triangles, Golden Triangles aren't equiangular triangles. Placing diagonals along these lines can make an otherwise static subject appear more dynamic.

      When you use Golden Triangles to break up your frame, you're creating an effect professional photographic experts call Dynamic Symmetry. Try to keep your focal subject on one of the intersecting points, and place other visual information into the triangles you've already divided out. The result will be a very attractive composition you may not have otherwise attained.

      Example 3.23. Photograph Composition Example Using Golden Triangle




    • Like the Rule of Thirds the Golden Sections affects the ratio of an image size as well as the placement of the main subjects on the photo. This ratio is close to the 35mm ratio, so you don't need to change the size of the photo in most cases. But you need to consider the composition: the main subject should lie on one of the four lines or four intersections (subject's eye for example). Truthfully speaking, these rules are not the same. Rule of Thirds is a simplified version of the Golden Mean.

      Example 3.24. Image Composition example using Golden Sections




The Flip Horizontal and Flip Vertical options can be used to apply flip transformation to the harmonious divisions.

The Color button lets you set the guidelines color. If you have an high color contrast image, the guidelines may become invisible. By the way, you can adapt the color guide to the current image.

Free Rotation

Gilles Caulier

Gerhard Kulzer

The digiKam Free Rotation is a tool for image rotation by any arbitrary angle.

When taking an image it is all too easy to hold the camera not quite perfectly vertical or horizontal, resulting in an image where things are tilted at an angle. The way to fix this with the digiKam Image Editor is to use the Free Rotation tool. Select TransformFree Rotation and adjust to the target angle.

Free Rotation Tool

Rotate your image by using the Angle slider (value in degrees). Press to Reset Values for reset the slider to zero. A rotating effect preview is available on the right side of the dialog. The new target image dimensions in pixels are shown.

For better orientation, the Free Rotation tool provides a vertical and horizontal guide. Move the mouse cursor under image preview to display the dashed line guide. Move the cursor to an supposedly vertical or horizontal feature in the image like the sea or a building border and press the left mouse button for freeze the dashed lines position. Now, adjust the angle accordingly with the guide.

Warning

After rotating the image, you often find that things are better but not quite perfect. One solution is to rotate a bit more, but there is a disadvantage to that approach. Each time you rotate an image, because the rotated pixels don't line up precisely with the original pixels, the image inevitably gets blurred a little bit. For a single rotation, the amount of blurring is quite small, but two rotations cause twice as much blurring as one, and there is no reason to blur things more than you have to. Sure, the guide tool available in the Free Rotation preview can help you to apply correctly at the first time an angle adjustment to an image.

Free Rotation action

The Free Rotation dialog tool in action is available below.

The Free Rotation Tool Dialog

After you have rotated an image, there will be unpleasant triangular "holes" at the corners. One way to fix them is to crop the image with TransformCrop Image Editor menu.

A more elegant way to crop the rotated image is to use the Auto-crop function. Choose anyone of the following options from the combo-box to your preference:

  • Widest area This option crops the rotated image to the widest possible (width) rectangular section.

  • Largest area This options crops the rotated image to the biggest surface.

Hold the mouse over the combo-box and scroll with the wheel between the two possibilities.

The Anti-aliasing checkbox will smooth the image a bit after rotation. Please read the warning above.

Perspective Adjustment

Gilles Caulier

Gerhard Kulzer

The digiKam Perspective Adjustment is a tool for adjusting the image's perspective.

With this tool you can work on the perspective in a photograph. This is very useful when working with photographs that contain keystone distortion. Keystone distortion occurs when an object is photographed from an angle rather than from a straight-on view. For example, if you take an image of a tall building from ground level, the edges of the building appear to meet each other at the far end. On the other hand you can use this tool to introduce a new perspective that is not a face-on view but to give the image a creative spin.

Using the Perspective Adjustment

All perspective transformations are performed around a fixed point called the reference point. This point is at the center of the item you are transforming and is displayed by a red circle.

To change the perspective, use the square areas at the image corners for dragging. The perspective preview is rendered automatically. On the right of the dialog you'll find a set of information witch help you to control the perspective change:

  • New Width: show the new image width in pixels including the empty area around the image resulting from the geometrical transformation.

  • New Height: show the new image height in pixels including the empty area around the image resulting from the geometrical transformation.

  • Top Left Angle: show the current angle in degrees at the top left corner of the perspective area.

  • Top Right Angle: show the current angle in degrees at the top right corner of the perspective area.

  • Bottom Left Angle: show the current angle in degrees at the bottom left corner of the perspective area.

  • Bottom Right Angle: show the current angle in degrees at the bottom right corner of the perspective area.

Warning

After applying the perspective adjustment, the image inevitably gets blurred a little bit. For a single adjustment, the amount of blurring is quite small, but two adjustments cause twice as much blurring as one, and there is no reason to blur things more than you have to.

After you have adjusted the perspective of an image there will be unpleasant triangular "holes" at the corners. One way to fix them is to crop the image with TransformCrop Image Editor menu.

The Perspective Adjustment in action

The Perspective Adjustment dialog in action is shown below.

The Perspective Adjustment Dialog

Shearing Image

Gilles Caulier

The digiKam Shearing Image is a tool for shearing an image horizontally or vertically.

The Shear tool is used to shift one part of an image to one direction and the other part to the opposite direction. For instance, a horizontal shearing will shift the upper part to the right and the lower part to the left. This is not a rotation: the image is distorted. In other words, it will turn a rectangle into a parallelogram. This tool is available from TransformShear menu.

Using the Sheartool

Shear your image by using the Horizontal Angle and Vertical Angle sliders (values in degrees). You can shear along either Horizontally and vertically at the same time. Click on the Reset Values reset. A shearing effect preview is shown on the center of dialog window. The new target image dimensions in pixels are displayed at the right side of dialog.

To assist you in aligning, the tool provides a vertical and horizontal guide. Move the mouse cursor under image preview for display the dashed lines guide. Move the cursor to an important place in the image like the sea or a building border and press the left mouse button for freeze the dashed lines position. Now, adjust the shear correction according with the guide.

Warning

After applying a shearing adjustment, the image inevitably gets blurred a little bit. For a single shearing, the amount of blurring is quite small, but two shears cause twice as much blurring as one, and there is no reason to blur things more than you have to.

After you have sheared an image, there will be unpleasant triangular "holes" at the corners. One way to fix them is to crop the image with TransformCrop Image Editor menu.

The Sheartool in action

The Shear Tool dialog in action is available below.

The Shear Tool Dialog

Adding decorative elements

Apply Texture

Gilles Caulier

The digiKam Apply Texture is a tool for applying decorative textures to an image.

By adding texture to your image, whether color or black and white, you can make it look like an oil painting on canvas, an Old Masters etching, a Pop Art portrait composed of enlarged half-tone dots, or even a mural on a brick wall. The ImageApply Texture Image Editor menu can be used for that.

Using the Texture Tool

The Apply Texture Tool Dialog

Two options give you control over the texture applying on image:

Type: this option specifies the decorative texture style to apply under the image.

Relief: dragging this option to the right increases the appearance of depth or three-dimensionality of the texture on image.

The Texture tool in action

A Paper texture effect apply to a photograph is available below. The original image is (1), the target image is (2). Relief factor used is 200.

The Texture Effect Preview

Add Border

Gilles Caulier

The digiKam Add Border is a tool to frame an image with decorative borders.

Keeping the viewer's interest within the confines of the edges of a photograph is not a simple task. One of the simplest ways to hold the attention on an image is to incorporate a decorative frame around an image. It acts as a kind of psychological barrier to the straying eye. The ImageAdd Border Image Editor menu can be used for that.

Using the Add-border tool

Four options give you control over the decorative frame rendering:

Type: this option specifies the decorative frame style to apply around the image. Solid style just surrounds the image with a colored line, Niepce style surrounds the image with a fine line and a large border (ideal for black and white images), Beveled style adds a neat dimension to your image (ideal to create a button effect), and Decorative style adds an ornamental border using patterns.

Width: this option specifies the border width in percents of image size. The border is added around the image. The width range is limited between 1% and 50%.

First: this option specifies the first color to use with the current border type.

Second: this option specifies the second color to use with the current border type.

Click on the OK button to apply the border around the current image.

Note

The border decorated target image will be bigger than the original, but it will retain the same aspect ratio. This is important for printing images, especially if you have used the Aspect Ratio Crop tool before.

The Add-border tool in action

The Add Border dialog tool in action is available below.

The Add Border Tool Dialog in Action

Insert Text

Gilles Caulier

Gerhard Kulzer

The digiKam Insert Text is a tool for adding text to an image.

This is a handy tool as it lets you add formatted text easily to an image wherever you want, at several places when needed.

Using the Insert Text tool

This tool seems very intuitive to use. Type in your text and place it with the mouse. Use the block settings as you please. Choose the orientation, color from a color space, and fonts with all their properties. You will have to scale the font size to the image size, the larger the image, the larger the font has to be! Finally choose to add a border around the text and/or a semitransparent background. Voilà, it's finished!

Any text setting you have chosen can always be changed as long as you don't click the OK button. In saved and reloaded images the text has become part of the image, it cannot be changed anymore.

The Insert Text tool in action

The Insert Text dialog tool in action is shown below.

The Insert Text Tool Dialog in Action

Template Superimpose

Gilles Caulier

Gerhard Kulzer

The digiKam Template Superimpose is a masking tool to superimpose templates to an image.

This tool allows to combine two images by superimposing them very easily. You can use this tool to re-frame your photographs and the story they tell. Existing images or artificially created graphics can be used as PNG template files containing borders, frames, gradients, and composite images that can be added to or superimposed on other images. Template files aren't installed along with the digiKam but can be found at this URL. Download the content to the digiKam album database and set the Root Template Directory.

The ImageTemplate Superimpose Image Editor menu is used to apply templates to an image.

To create new templates

New templates can be created using any paint program, and the template must be stored on disk. Colored areas in the image will become a mask that will later be superimposed on another selected image. PNG template files must be created in RGB mode with Alpha channel. The alpha channel represents transparent areas in the template that will not show in the superposition. The selected image upon which the template file is superimposed will appear in place of the transparent areas in the template.

There is no restriction on template size and orientation, but you must use PNG file format with max. compression (9) to reduce the template file size. If you want to add your template creation to the digiKam templates database, please send a mail to this digiKam mailing-list .

Using the Superimpose Tool

If you are using the tool for the first time, you must set your local templates directory using the Root Directory button in the dialog. Select the folder where you have copied the template files. The widget remembers this setting at the next instance.

When the root template directory is set, a folder tree view is created which displays the template directories structure. Selecting one will update the templates preview bar automatically.

Below the preview area, three buttons give you control over the template zoom and position on your image:

Zoom In: this button increases the underlying image's zoom factor. The image is centered to the current mouse position. Validate with the left mouse button.

Zoom Out: this button decreases the zoom factor. The image is centered to the current mouse position. If you want to apply the template to the full image you have to zoom out fully. Validate with the left mouse button.

Move: use this button to pan the underlying image. Click and drag the image with the right mouse button.

Click on the OK button to apply the template to the current image, which in turn will be automatically resized to the preview size.

The Superimpose in action

The Template Superimpose dialog tool in action is available below.

The Template Superimpose Tool Dialog

Special Effects (Filters)

Simulate Infrared Film

Gilles Caulier

Gerhard Kulzer

The digiKam Infrared Film filter simulates traditional infrared film material.

Simulating classical infrared film material (the effect is rendered in black and white) is an interesting alienation effect that is even stronger and more dramatic than pure black and white conversion. Contrast and an abstract touch are improved, which can underpin the expression of the photographer as an artist. It is like taking an image in black and white with a red filter on the camera lenses. Areas which reflect little red light, e.g. the sky, will show as low density, dark areas. Areas which are excellent reflectors of red light, e.g. most green foliage, will be high density areas. And snow landscapes are really dramatic.

The algorithm is based on the method of the 'Simulate Infrared Film' tutorial of the GimpGuru.org web site available at this url. The filter tries to reproduce the famous Ilford(tm) SFX200 infrared film. This film has a sensitivity range of 200-800 ISO.

Using the Infrared Filter

The left part of the dialog window lets you select the region to be shown in the preview section. Move the red rectangle with the mouse around to show the effect on different parts of the image.

The lower part provides the two controls, Film Grain and ISO sensitivity. Check the Add Film Grain box if you want to simulate the grainy texture of a high sensitivity film. The ISO-level slider modifies the amount of filmgrain added and the predominance of green color (chlorophyll in nature) in the conversion mixer. Green pastures will become white as snow! Try it out.

Note

Because the filter mixes color channels to reproduce infrared film (with emphasis on green channel), one can not simulate infrared effect from black and white original photograph, since the color information is missing.

The filter in action

This is an example of the infrared film effect applied to a color image taken in New Zealand's landscapes. The original image is (1) and the converted image is (2). The film sensitivity used to simulate the infrared film is ISO-400. Higher ISO values will create a kind of aura in the highlights.

The Infrared filter in Action

Film Grain

Gerhard Kulzer

The digiKam Filmgrain filter reproduces traditional film grain techniques of high speed films.

The digiKam Filmgrain filter is an easy tool to produce film grain on your images as known from classical high speed film material as, for example, the famous B/W KodaK Tri-X. In order to increase film sensitivity, manufacturers employed larger silver grains in the photo emulsion.

The film grain effect gives your shot a particular mood or seems to transport it in time. The treated image acquires a timeless atmosphere, detached from every day life. If you want that gritty, art-house, street-photography grainy film look, especially in monochromatic photos, use this filter.

Using the Filmgrain filter

There is a slider calibrated in ISO-sensitivity to control the grain intensity and granularity. The default is set to ISO-2400, although higher values are often required. If you still want more grain, apply the filter several times.

The filter in action

This is an example of the film grain effect applied on a black and white image. The original image is (1) and the corrected image is (2). The film sensitivity used for simulate the film graininess is ISO-1600.

The Film Grain Filter in Action

Oil Paint

Gerhard Kulzer

The digiKam Oil Paint filter gives your image the look of an oilpainting. It uses an algorithm copyrighted by Pieter Voloshyn.

The digiKam Oil Paint filter gives your digital images a nice oilpainting-like look. Images of nature and still lifes are well suited for this effect.

Using the Oil Paint filter

There are two sliders to control the effect. The upper slider selects the Brush Size between 1 and 5. Bigger brushes are better suited for large images. Smooth controls the smoothness or, seen from the other end, the jaggedness.

The Oil Paint filter in action

This is an example of the oil paint filter effect. The original image is (1) and the transformed image is (2). Brush Size for this 640 pixel size image is 1, Smooth is 17.

Oil Paint Image Effect Preview

Charcoal Drawing

Gerhard Kulzer

The digiKam Charcoal is an effect filter that creates a charcoal sketch-like result.

The digiKam Charcoal filter uses the gradients of color and luminosity to produce a grey scale charcoal sketch. The lines defining the outline of the image are pronounced. Images with slowly changing gradients are not ideal for this effect. It is helpful to imagine what scene you would pick to do as a hand sketch yourself, in order to choose the image to start with.

Using the Charcoal filter

There are two sliders to control the effect on a scale of 1-100. The upper slider selects the pencil size, whereas the second slider adjusts the contrast (smoothness).

The Charcoal filter in action

This is an example of the charcoal filter. The original image is (1) and the transformed image is (2). Default values of 30 and 10 where applied. The result can be improved by adjusting the luminosity levels.

The Charcoal filter in Action

Emboss Image

Gerhard Kulzer

The digiKam Emboss filter sculptures your image into 3-D as if it were stamped into wax. It uses an algorithm copyrighted by Pieter Voloshyn.

The digiKam Emboss filter is a quick tool to render your images in a 3-D effect. It works particularly well on images with simple structure where color is not the most important content. The filter uses the difference between colors and luminosity to convert it into a grey, moon-like landscape lit from 10 o'clock.

Using the Emboss filter

The Depth control allows to define the contrast of the filtering. A value of 30 (10%) is the standard.

The Emboss filter in action

This is an example of the emboss filter. The original image is (1) and the transformed image is (2). The Depth applied is 10%.

The Emboss filter in Action

Distortion FX

Gilles Caulier

Gerhard Kulzer

The digiKam Distortion FX is a series of distorting effects for digital still images.

With this filter set, you can transform an ordinary photograph into a work of art suitable for framing using distorting operations. It uses algorithms copyrighted by Pieter Voloshyn.

Using the filter

These are the distorting effects available:

TypePreview
Fish Eyes: warps the photograph around a 3D spherical shape to reproduce the common photograph 'Fish Eyes' effect.

Twirl: spins the photograph to produce a Twirl pattern.

Cylinder Horizontal: warps the photograph around a horizontal cylinder.

Cylinder Vertical: warps the photograph around a vertical cylinder.

Cylinder H/V: warps the photograph around a 2 cylinders, vertical and horizontal.

Caricature: distorts photograph with 'Fish Eyes' effect inverted.

Multiple Corners: splits the photograph like a multiple corners pattern.

Waves Horizontal: distorts the photograph with horizontal waves.

Waves Vertical: distorts the photograph with vertical waves.

Block Waves 1: divides the image into cells and makes it look as if it is being viewed through glass blocks.

Block Waves 2: like Block Waves 1 but with another version of glass blocks distortion.

Circular Waves 1: distorts the photograph with circular waves.

Circular Waves 2: other variation of Circular Waves effect.

Polar Coordinates: converts the photograph from rectangular to polar coordinates.

Unpolar Coordinates: Polar Coordinate effect inverted.

Tiles: splits the photograph into square blocks and move them randomly inside the image.

Warning

Some effects can take a long time to run and cause high CPU load. You can always abort an effect by pressing Abort button during preview rendering.

The Distortion filter in action

The Distortion FX dialog tool in action is available below.

The Distortion FX Dialog Tool Preview

Blur FX

Gilles Caulier

Gerhard Kulzer

The digiKam Blur FX is a series of blurring effects for digital still images.

With this filter set, you can transform an ordinary photograph into a work of art suitable for framing using blurring operations. It uses algorithms copyrighted by Pieter Voloshyn.

Using the Blurfx

These are the blurring effects available:

TypePreview
Zoom Blur: blurs the image along radial lines starting from a specified center point. This simulates the blur of a zooming camera, thereby giving the photograph a dynamic expression as often seen in sport photography.

Radial Blur: blurs the image by rotating the pixels around the specified center point. This simulates the blur of a rotating camera.

Far Blur: blurs the image to simulate the effect of an unfocused camera lens. The subject seems to recede into the background.

Motion Blur: blurs the image by swishing the pixels horizontally. This simulates the blur of a linearly moving camera, i.e. like a shot taken from a car or train.

Focus Blur: blurs the image corners to reproduce the astigmatism distortion of a lens.

Softener Blur: blurs the image softly in the darker tones and strongly in the high lights. This gives photographs a dreamy and glossy soft focus effect (Hamilton effect). It's ideal for creating romantic portraits, glamour photography, or adding a warm and subtle glow.

Shake Blur: blurs the image by randomly moving the pixels simulating the blur of an arbitrarily moving camera.

Smart Blur: finds the edges of color in photograph and blurs them without muddying the rest of the image.

Frost Glass: blurs the image by simulating randomly dispersing light filtering through hoarse frosted glass.

Mosaic: blurs the image by dividing the photograph into rectangular cells and then recreates it by filling those cells with average pixel value.

Warning

Some effects can take a long time to run and cause high CPU load. You can always abort an effect by pressing the Abort button during preview rendering.

The Blurfx in action

An example of the Blur FX dialog in action is shown below.

The Blur FX Dialog Tool Preview

Rain Drops

Gerhard Kulzer

The digiKam Raindrops filter puts beautiful raindrops on your image.

The Raindrops is nice little tool to put raindrops onto your images. Naturally, it renders your image in a kind of wet look. It uses an algorithm copyrighted by Pieter Voloshyn.

Using the Raindrops filter

Three sliders give you control over the effect filter:

Drop size obviously allows to change the size of the drops. As the drop size doesn't automatically scale with the image size it is often necessary to reduce the size for small images. Number changes the number and density of drops. Fish eye changes the optical effect of the drops across the image.

Note

You can keep a zone clear of raindrops with the digiKam Image Editor Select tool. Selecting the area to avoid (for example a face) before launching the Raindrops filter will keep it free from rain drops.

The Raindrops filter in action

This is an example of the raindrops filter. The original image (1) shows a quiet sunset, the transformed image (2) indicates a sunset after a thunderstorm. Default values have been used for this example.

Rain Drops Image Effect Preview