Outils pour utilisateurs

Outils du site


issue162:krita

Ceci est une ancienne révision du document !


This series is aimed at learning to make something of the old photos in my possession, and others in the public domain due to their age. You, the reader, are welcome to tag along, and, I hope, glean some small insight and perhaps an idea or two from time to time. No promises are made as to quality of the content, or potential errors and omissions. I am a computer scientist, not a true artist or a professional of image restoration. So please take all this as a best effort, but with no firm guarantees — much as is the case of most open-source software.

In the previous part of this series, we worked on a technique that is often used in museum photo recreations, and consists of bringing out the main subjects of an image in color, while the background remains in black and white. In this final part of this series on using Krita to rework old photos, we will stay with early digital images and work on color density and enhancement.

Exhibit A for this article is a photo I took in Hong Kong, just after the Olympic Games back in 2008. At that time, digital cameras were beginning to get better, and problems with lack of resolution were starting to be resolved (but can one really ever have sufficient resolution?). On the other hand, modern image enhancement techniques were absent, such as High Dynamic Range (HDR) in which several pictures of the same scene are taken at varying exposure points, then combined to build a single photograph with more details both in the shade and in highly illuminated parts of the image. Other color enhancement schemes are now commonplace.

Some of these techniques would have been useful to me back in 2008. In this image, we get some interesting colors from the setting sun (to our left, outside the field of view), but at the same time there are sharp shadows in which all detail has been lost. This is perhaps most noticeable in the buildings at the far left, whose facades are in-shadow, and present a perhaps slightly ominous and not very attractive backdrop to the harbor.

The first thing to do, as usual, is take a look at the histogram.

It is interesting to note the contribution of different areas in the image to the overall pixel count. For instance, the clear blue sky and part of the water would seem to make up a large proportion of lighter pixels. However, the large blue pixel count seen to the right of the histogram actually denotes a lack of blue and excess yellow in lighter colors of the histogram. On the other hand, there is a large amount of reddish pixels in the mid-tones in the histogram, that in fact correspond to an excess of blue in these shades. So, to correctly interpret this histogram, we need to think in terms of the water and sky actually being situated in the mid-tones of our histogram – they are not actually the lightest pixels of our image. These would be, rather, the yellowish reflections of the chromed railing and the reddish wall to the right of the image.

Finally, most dark pixels would seem to have some lack of blue to them, which is coherent with the darker shades of water and the buildings in the shade – shadows often contain a slight tinge. However, there is a fairly lower amount of dark pixels, than light.

To correct these aspects and extend, as much as can be, the dynamic range of our image, it would be nice to accentuate the gradient of colors in the lower part of the histogram, giving lighter shadows a tad more detail while retaining some darker shades as such. On the other hand, it may also be worth extending some mid-range pixels up to lighter colors, though only for the red and green channels. The red channel already extends right up to the right-hand limit, and cannot be adjusted further. So, let us go into the menu option Filter, Adjust, and Color adjustment curves. Selecting the Lightness channel, let us move up a tad the lower curve section:

This takes care of the lower (darker) section of the histogram. Now, let’s go back once more into Color adjustment curves, and now choose to modify only the Blue channel. When a single primary channel is selected in this tool, a specific histogram of this color is presented within the adjustment curve, and we can indeed see that there is a distinct lack of blue pixels in the lighter (right) part of the curve. Let us adjust this, by bringing the top right-hand extremity of the curve to the left, until it is above the right-most edge of the histogram edge. A similar adjustment may be done to the left.

Do not worry if the image now has a slightly blue tinge to it - this is normal, since we have in essence increased the amount of blue light in the photo. Now, proceed in the same way for the green channel.

The end result is an image that now has a rather extended dynamic range, since we can see further details both in very light areas and within the shadows. This is especially visible in the darker areas underneath the railings, and in the facades of the leftmost buildings over the water: we can now actually see their rows of windows, instead of just an unformed mass of gray.

The effect is also rather different than that of the original image. We have gained some readability, but this has come at the expense of character. While our photo is now more nicely balanced as regards luminosity, its colors are more neutral – and, perhaps, also a tad lackluster. To solve this problem while retaining luminosity, let us augment the saturation of the image. We could go back once more to the adjustment curves, or even choose Filter > Adjust > HSV Adjustment, and increase the saturation of the whole image. But there is another option – that will allow us to increase the saturation of only some parts of the scene. In this case, I would like to leave most of the sea and sky as is, and increase the saturation of only the brown wall to the right and the reflections of the sun on the railing. Since these are pixels with rather more red to them than other channels, their saturation can be adjusted selectively by using the tool at the menu option Filter > Adjust > Cross-channel adjustment curves.

As the title suggests, this tool allows the adjustment of one channel or pixel characteristic, based upon another. We have already used them in part 9 of this series. In this case, however, we need to select pixels with a shade of red to them. This can be done using the Red channel as driver; however, if we do so, other pixels will get picked up. Even pure white contains a large amount of red inside it, so the end result can easily get unexpected colorization. It is best to choose Hue as the driver channel. Specific hue values are not indicated on the curve, but one can experiment a little and observe that red hue is to the extreme left of the input range, then we move on successively to orange, yellow, green and violet as we proceed from left to right. In the capture below, we can see I used a number of control points to increase saturation for a certain range of hues centered about the orange, but with a bit of margin towards pure red (left of our maximum) and yellow (right). I increased saturation values only by a very small amount. High ranges of saturation quickly degrade into a comic-like exaggeration of color. This is unfortunately common nowadays to some cameras’ automatic color enhancement schemes, and even some professionally mastered videos. Even exercising care, I have purposefully let the saturation creep up to a slightly higher value than I would normally use, so it should be rather perceptible to you, the reader.

The end result is a scene that looks brighter and has more engaging colors than the original image.

As previously stated, this will be the last part of this series on reworking old photos using Krita. As usual, the author himself has learned a lot while preparing the articles, and hopes that readers have also picked up a few useful tips and tricks. For the next few months, most articles will probably leave the more artistic realm and go back to techy stuff as usual, unless readers' ideas and suggestions come in for some particular use-case of our favorite operating system. Until then, take care!

issue162/krita.1604233857.txt.gz · Dernière modification : 2020/11/01 13:30 de auntiee