Edit photos with Krita
Creative Workshop
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.
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.
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.
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.
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.
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.
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.
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).
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
(incl. VAT)
Buy Linux Magazine
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.
News
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.
-
Linux Foundation Adopts OMI to Foster Ethical LLMs
The Open Model Initiative hopes to create community LLMs that rival proprietary models but avoid restrictive licensing that limits usage.
-
Ubuntu 24.10 to Include the Latest Linux Kernel
Ubuntu users have grown accustomed to their favorite distribution shipping with a kernel that's not quite as up-to-date as other distros but that changes with 24.10.