Edit photos with Krita

Creative Workshop

Article from Issue 274/2023
Author(s):

Not many people are aware that Krita, the popular open source painting program, is also great for editing photos.

Few photographers are aware that Krita, the popular painting program [1], can also be used to edit photos. Considering that many illustrators and graphic designers use Photoshop or Gimp for digital painting and drawing, this is not surprising.

In fact, Krita's approach is identical to that of classic layer-based image editors in terms of the basic functions. However, it has several pretty significant advantages compared with Gimp. On the one hand, Krita lets you edit photos in large color spaces like Adobe RGB. This is especially important if you want to print a high-quality image with intense colors. On the other hand, Krita has filter masks, a counterpart to Photoshop's adjustment layers. They allow for far more comfortable image editing, because numerous effects can be adjusted retroactively and masks can be edited directly in the layer.

Krita is also one of only a few graphics programs that support 10-bit screen output. In combination with a 10-bit capable monitor, this gives you a far more accurate display of fine color nuances and gradients. In the following, I will use a concrete example to demonstrate how photo retouching with Krita works. (The original image can be found online [2].)

Customizing the Settings

Before you start working, you will want to change some preferences in Krita. First, make sure that the application is using the correct screen profile. Then enable a brighter user interface, because the dark default setting makes it difficult to judge the image brightness. Last but not least, display the image overview, which helps you move the view more easily when zoomed in on the preview.

To set the screen profile, start Krita and click Settings in the menu. After that, select Color Management on the left sidebar of the settings window. Then click Display in the Color Management settings options and uncheck Use system monitor profile (Figure 1): My experience is that automatic detection of the system monitor profile does not work reliably.

Figure 1: Before starting the actual work, make sure that Krita is using the correct monitor profile.

Further down, you will see a list of monitors connected to your PC, each with a drop-down list. Unfold the drop-down list next to the monitor you are using and select the appropriate screen profile. It may not appear in the list at first. To import it, click Import profile, navigate to the profile, select it, and then click Open. Now the name of the profile should appear in the drop-down list next to the monitor. Press OK to confirm the change and restart Krita.

To change the color of the user interface, just click Settings | Themes | Krita neutral. For a display of the image overview, navigate to Settings | Dockers and enable the Overview item at the very bottom of the list. The overview then docks onto the interface top right under the dock for the extended color picker. To view it, navigate to the Overview tab.

Importing Raw Data

To open the sample file provided for download, click the button with the small folder icon in the top left corner or use the keyboard shortcut Ctrl+O. Because the sample image is a raw file, the RAW Import dialog appears (Figure 2). In principle, there is little you need to change in the settings. If you use a monitor with a larger color space than sRGB, adjust the setting for Workspace in the Color Management group at the bottom (not shown in Figure 2). In my opinion, AdobeRGB or WideGamut seem to make sense here – use WideGamut only if the monitor supports a significantly larger color space than Adobe RGB, however.

Figure 2: The RAW importer lets Krita load raw camera data.

One interesting item in the first group, Demosaicing, is the setting for Quality, where you specify how Krita descreens the image (i.e., adds missing pixels in the individual color channels). The default setting seems less than perfect because it creates an unnecessarily soft image. It is only usable if the image has too much noise or if you want to increase the brightness or contrast afterwards. Of course, this will generate noise again. For reasonably correct exposure and not too much noise in your photos, you might want to use AMaZE instead. You may want to try the demosaicing algorithms to see which one works best for a specific photo. After changing a setting, click Update at the bottom and check the results in the preview window on the right.

In the White Balance group, you will not only find the settings for this, but also presets for exposure compensation and for reconstructing highlights (i.e., the brightest, possibly overexposed, image zones). The default Camera setting is usually fine for white balance. If not, try the Automatic setting or try setting the white balance manually.

However, the results cannot really be judged well in the preview window, which shows only a small part of the image in the 100-percent view on most screens. Be sure to uncheck Automatic Brightness. This will be easier to adjust later on when you see the whole image.

Provided that there are overexposed areas in the photo, experiment with the settings next to Tip Reconstruction. The Blend and Rebuild methods seem to be interesting here; Blend gives you a good default setting for normal photos, too. You can keep the settings in the Corrections group. Finally, press OK to open the photo in Krita.

Image Settings

In the program window, you will see a large preview window at the center. At the top, you'll find two toolbars that let you open images and change brush settings, among other things. On the left edge there is a dockable dialog in the form of a toolbar (Figure 3). It contains important tools such as various selection tools, the brush, or the crop tool.

Figure 3: Following the example set by Photoshop, Krita arranges the editing tools around the large preview window.

You will find other dockable dialog windows to the right of the preview window. The layers, the overview, the brush settings, and the tool options are the most important for photographers; the tool options' content varies depending on the selected tool. In the status bar below the preview window, Krita displays a variety of information, including the image size and the working color space.

When working with Krita, the first thing you need to do is duplicate the background layer. If possible, perform each individual editing step on a separate layer. This makes it easier to undo or adjust an editing step.

In the Layers panel, after opening an image, you will see a single layer, the Background layer. Right-click this layer with the mouse and choose Duplicate Layer or Mask from the context menu. Now you will see a second layer in the Layers panel named Copy of Background. It is located above Background and hides it.

First, you will need to lighten the image. To do this, place a filter mask with the Color Adjustment filter on the Copy of Background layer. Where possible, perform each editing step as a filter mask. This is a special type of layer that has several advantages over normal layers. It does not contain pixels, only setting parameters for effects that apply to the layer below. Filter masks make it easier to adjust the setting options or the intensity of the filter. In addition, you can paint directly on the layer with the brush to exclude certain areas of the image from the effect.

To create a filter mask for a specific layer, first select the layer – in this case Copy of Background. Then, in the lower left corner of the Layers window, click the small upside-down triangle next to the button with the plus sign. From the menu, select the Add Filter Mask option; this will launch the filter mask dialog. You will see the list of available filters divided into several groups on the left, and the setting options for the currently selected filter on the right.

The Color Adjustment filter (Figure 4) belongs to the first group Adjust. This is actually the curve tool. You will see a rectangle dividing a diagonal line rising from the bottom left to the top right. The dark pixels of the image are assigned to the left half of the rectangle, and the light pixels to the right. To lighten the whole image, set a point in the middle of the diagonal or curve and drag it upwards.

Figure 4: In the first phase of brightness correction, you need to lighten the image slightly using the tone curves.

This approach brightens the pixels with medium brightness more than the rest. But only brighten the photo to the point where the brightest areas of the image reach the desired brightness. Clicking OK applies the effect. You can see the filter mask you created in the Layers panel as a slightly indented white layer below the Copy of background layer. Assign a new name so that later you will know which editing step you performed on it. To assign a new name, double-click the name of the layer.

In the next step, lighten the dark parts of the image. To do this, first select the dark zones. Make sure you select the Copy of Background layer and not Brighten 1. You cannot create a selection on the filter mask layer because it does not actually contain any pixels. Then click Select | Select from Color Range in the menu (Figure 5) and, in the new dialog, select Shadows in the drop-down list at the top left. Then click Select and OK. You will now see a bright dashed line in the preview window at the edge of the selected area that appears to move like a column of ants.

Figure 5: In the second step, use the Color Range tool to select the dark areas of the image.

A new white layer named Select Mask will appear at the top of the Layers panel. Clicking on it highlights the masked – that is, unselected – areas in red. In the sample image, these are the sky and the white foam of the waves (Figure 6). Click on the Copy of background layer again, because you want to lighten it. Now create a filter mask again with the Color matching filter and drag the curve in the middle upwards. Let's name the new layer Brighten 2 – Color Adjustment.

Figure 6: When you click the selection mask in the Layers panel, Krita highlights unselected image zones in red.

The image now has the correct brightness on the whole, but the transition between masked and unmasked or brightened and unbrightened areas is too harsh. You can see a dark line on the horizon, and the foam of the waves is too dark. We need to soften the filter mask layer. To do this, select the Brighten 2 – Color Adjustment layer and then click Filter | Blur | Gaussian Blur (Figure 7). In the next dialog, set the values of Horizontal Radius and Vertical Radius to 1,000 pixels each. This gives you pronounced blurring of the filter mask, and the hard selection edges disappear.

Figure 7: After lightening the dark zones, use the Gaussian blur to soften the filter mask so that the transitions do not appear too harsh.

To increase the intensity of the colors, create another filter mask for the Copy of Background layer. This time, however, use the HSV/HSL Adjustment filter (Figure 8). To increase the color saturation, set the value of Preserve Saturation to about 67 in the filter settings window. Then assign a name to the new filter mask layer (e.g., Saturation).

Figure 8: At the end of the first editing phase, we have increased the color saturation using the HSV filter mask.

Finally, I'll add some contrast to the image at the end of the first editing phase. You can also do this with the Color Matching filter as a filter mask. Increasing the contrast means nothing more than darkening the dark pixels and brightening the light pixels. This is why the curve looks S-shaped.

However, my example does not need contrast enhancement in the strict sense, because the sky and the waves are bright enough. A true S-curve would make the sky too bright. The idea is to define two points on the color-matching curve to divide the curve into three equal stretches. The upper point is only a fixation point; its vertical position does not change. To define the second point, drag the point in the bottom/left half of the curve down a little.

You may well need to adjust the settings of the individual filter masks when done. To do so, right-click the filter mask layer and select the first entry Properties from the context menu. The setting options for the filter now appear.

Now I'll apply some corrections using the G'MIC filter collection, which is available for Krita as an extension module. The current AppImage version comes with them in place. However, with many Linux distributions, you have to install G'MIC retroactively.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Krita Vs. MyPaint

    If you are looking for an open source drawing program, Krita and MyPaint both offer graphic tablet support and brushes. Deciding which one works best depends on your specific needs.

  • Krita Storyboard Docker

    Krita 5 includes an editor that makes it easy to prepare storyboards for any purpose, including unexpected ones.

  • Perl: Photos Effects

    With the GIMP image editing program, and a little help from Perl, you can enhance your digital photos and transform a modern image into a nostalgic turn-of-the-century shot.

  • G'MIC

    Behind G'MIC's deceptively simple interface hides a mighty image processing framework. While mastering G'MIC can be a rather daunting proposition, here's how to get started.

  • Perfect Balance

    The current RawTherapee version finally adds selective image editing, among other long-desired features, to help it compete with king of the hill, darktable.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News