Outils pour utilisateurs

Outils du site


issue157: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 photo that had been transformed to a digital format by simply photographing it using a modern mobile phone. In some cases, however, we do not have a paper copy of the original. For instance, in the latter days of chemical photography, many photo developing shops were delivering CD copies of your photos, already digitized. These also can have some drawbacks, which we will review today. Exhibit A is a typical holiday pic from the Sicilian city of Syracuse I took back in 2004, using a reflex 35 mm camera and standard photographic film of the time.

Cette série a pour but d'apprendre à faire quelque chose des vieilles photos en ma possession, ainsi que d'autres du domaine public du fait de leur âge. Vous, lecteur, êtes bienvenu pour m'accompagner et, j'espère, glaner quelques petites particularités et une idée ou deux de temps à autre. Je ne fais aucune promesse sur la qualité du contenu, ou sur les erreurs et omissions possibles. Je suis un scientifique en informatique, pas un artiste ou un vrai professionnel de la restauration des images. Aussi, merci de considérer ça comme mon meilleur effort, mais sans garanties fermes, comme c'est souvent le cas dans les logiciels Open Source.

Dans la partie précédente de cette série, nous avons travaillé sur un photo qui a été transformée en format numérique simplement en la photographiant avec un téléphone mobile moderne. Cependant, dans certains cas, nous n'avons pas de version papier de l'original. Par exemple, dans les derniers temps de la photographie argentique, beaucoup de labos photos de développement livraient des copies sur CD de vos photos, déjà numérisées. Ceci peut avoir quelque inconvénient, dont je vais parlé aujourd'hui. Exhibit A est un photo de vacances typique de la ville sicilienne de Syracuse que j'ai prise en 2004, en utilisant un appareil-photo reflex de 35 mm et un film photographique classique de l’époque.

The laboratory produced a CD with scans of each photo in JPEG file format. If we have Imagemagick installed, we can access EXIF information from the command line. In this case, we find that the original negative film was scanned by the laboratory with resolution 1840×1232 (top right). We can obtain most of this information even with the standard file utility, though the two programs are not quite in agreement as regards spatial resolution (bottom right). Anyhow, it is clear that modern digital photography has gone a long way to improve on what was standard technology 15 years back, with typical mobile phone camera pixel counts more than 4 times greater. But, what about file quality? If we zoom in on the image in Krita, we find that there are some visible defects.

Le laboratoire avait produit un CD avec un numérisation de chaque photo au format de fichier JPEG. si ImageMagick est installé chez vous, vous pouvez accéder à l'information EXIF à partir de al ligne de commande. Dans ce cas, vous trouverez que le film négatif original a été scanné par le laboratoire avec un résolution de 1840×1232 (en haut à droite).

Nous pouvons obtenir la plupart de ces informations avec un utilitaire de fichier classique, bien que les deux programmes ne sont pas tout à fait d'accord sur la résolution spatiale (en bas à droite).

Quoiqu'il en soit, il est clair que la photographie numérique moderne a largement amélioré ce qu'était la technologie standard d'il y a 15 ans, avec le nombre de pixels 4 fois plus grand qu'on compte dans un téléphone mobile typique. Mais qu'en est-il de la qualité du fichier ? Si vous agrandissez l'image dans Krita, vous trouverez qu'il y a des défauts visibles.

The sky is noticeably grainy. So are any other flat parts of the image, though it is slightly less noticeable on buildings or the ground. There are also the typical compression artifacts that the JPEG fractal algorithm produces, which are particularly marked along diagonal lines, and in the vicinity of curves. Unfortunately, this is information that has been lost during compression, and is a fact we will need to accept. From here, we can either reduce the image resolution to try to “repair” these defects, or seek out a better original to work from, for example, making a digital photograph of the original paper copy if we still have it in good state.

Le ciel est notablement grainé. De même que d'autres aplats de l'image, bien que ce soit légèrement moins évident sur les bâtiments ou le sol. Il y a aussi les défauts typiques de compression que l'algorithme fractal du JPEG produit, qui sont particulièrement marqués dans les lignes diagonales et au voisinage des courbes. Malheureusement, ce sont des informations qui ont été perdues dans la compression et que nous devons accepté comme un fait. À partir de là, nous pouvons soit réduire la résolution de l'image pour essayer de « réparer » ces défauts, soit rechercher un meilleur original à partir duquel travailler, par exemple ,en faisant une photographie numérique de la copie papier d'origine si elle est encore en bon état.

If we suppose this digital scan is the only copy we have available, let us begin by reducing the resolution of our image. Bear in mind that the original resolution is 1840×1232, so a proportion of nearly (but not exactly) 1.5:1 or 3:2. This proportion is close to that of many traditional photographic paper sizes, though it may seem slightly weird to younger readers who would be more accustomed to digital image proportions of 4:3 as on standard monitors, or 16:10 / 16:9 as on panoramic monitors and some mobile phones. In Krita, we can bring this resolution down by using the tool at menu option “Image”, “Scale image to new size”, and then put in our new resolution. If we have the “Constrain proportions” checkbox set, we should just need to enter one of the dimensions, and the other will be calculated automatically. In this case, I entered 1200 pixels for the image width, and the program calculated the height as 803 pixels. Let us close in on the same area as before.

Si nous supposons que cette numérisation est la seule copie disponible, commençons par réduire la résolution de notre image. Gardez à l'esprit que la résolution d'origine est de 1840×1232, soit une proportion d'à peu près (mais pas exactement) 1.5:1 ou 3:2. Cette proportion est est proche de ce qu'étaient de nombreuses tailles de papier photographique traditionnel ; Bien que ça puisse paraître un peu bizarre aux lecteurs les plus jeunes qui plus accoutumés aux proportions des images numériques de 4:3 des écrans classiques ou celles de 16:10 / 16:9 des écrans panoramiques et de certaines téléphones mobiles. Dans Krita, nous pouvons réduire cette résolution en utilisant un outil de l'option de menu « Image », « Scale image to new size » (Redimensionner à une autre taille), puis en saisissant la nouvelle résolution.

We observe that, just by reducing the pixel resolution, most of the artifacts present in the sky have been ironed out. Those introduced by compression on diagonal lines and curves are still there, though perhaps a tad less pronounced. The close-up above is at a zoom factor of about 200%; it is clear that this image may be useful on screen as a wallpaper or in a presentation. However, it simply lacks information to be reproduced as a good-quality paper print - and there is not much we can do about this. Even in Krita, scaling our image back up to a larger resolution will not get us back any of the information lost. Let us try with 4500 x 3000 pixels.

Nous observons que, juste en réduisant la résolution en pixels, la plupart des défauts présents dans le ciel ont été réduits. Ceux introduits par la compression sur les lignes diagonales et les courbes sont encore là, bien que moins prononcés. La vue de détail ci-dessus est un agrandissement à anviron 200 % ; il est clair que cette image peut être utile à l'écran comme papier-peint ou dans une présentation. VCependant, il manque quand même des informations pour qu'elle soit reproduite sur papier avec une bonne qualité - et il n'y a pas grand chose à faire pour cela. Même dans Krita, la redimensionner à une plus grande échelle ne fera pas revenir toutes les informations perdues. Essayons à 4500 x 3000 pixels.

Image quality is not better at 4500 x 3000 than at 1200×800 pixels, but it is not worse either. We can see that Krita does a pretty good job of scaling upwards by interpolating the colors of new pixels from those present at the lower resolution. But, obviously, it cannot introduce more information than is already present. Still, scaling downwards to a slightly lower resolution, and then back up, is a useful trick that can eliminate some of the artifacts introduced by excessive JPEG compression of the original. Being Krita, there are also tools to do this job automatically. Starting once more from our original image at 1840×1232 pixels, I selected the menu option “Filter”, “Enhance”, and the tool “Wavelet noise reducer” already used in a previous part of this series. This reduced the splotches in the sky, but did not affect the artifacts around lines and curves.

Once the image quality was as good as it was going to get, I went back to the image as a whole. The scene was more or less satisfactory, with a nice yellowish tinge from the subset illuminating the building to the left. However, the sky lacked a bit of character for my taste. I set about remedying that by adding a new layer, on top of the original image. Then, using the gradient tool, I drew a vertical gradient over the sky on the new layer. Krita’s gradient tool, in its default settings, works by applying whatever brush color is active at the point where the gradient tool is applied, and then progressively working over to a completely transparent color at the point of release. Here, I applied the tool at the top of the image, and then released it halfway down to the bottom in a vertical line. However, I did not wish to superimpose the color on top of the original, but rather use the gradient as a way to increase color saturation. So, this new layer was combined not in “Normal” mode, but as “Saturation”. Any color can be used for this trick; transparent parts of the gradient will have no effect on the color of the original, and pixels with color will increase the original’s saturation in proportion to their color density. The end result is a more vibrant sky, that brings out a more interesting cloud formation and gives extra character to the scaffolding on the church at the opposite end of the piazza.

Finally, I wished to increase the contrast between the darker street scene to the right, and the lighter buildings to the left. One way of doing this is to give the dark part a slightly colder color tinge, towards the green or blue. But, I did not want to reduce the amount of red and yellow in the sky and lighter buildings. Luckily, Krita has a very powerful tool that allows us to work on one color channel, controlling it from another. In the menu option “Filter”, “Adjust”, select “Cross-channel adjustment curves”. In this case, I wanted to alter the red channel. On the other hand, my control channel was to be “Lightness”. Then, I altered the curve to reduce the response to the left (darker side of the curve). In essence, what I was doing was to reduce the red component for all pixels with low lightness – i.e., the dark bits of the image. Since these are mostly in the right lower corner of the photo, this is the part that got reduced redness, thus increased green and blue.

The end result may lack the resolution we would wish for in modern times, but at least there are less niggling artifacts in the sky and architectural details, and the colors are bit more bright and joyful than in the original CD file. In this part of our series, we worked on a photograph that had been digitized professionally by the laboratory when our negative film was developed. At times, however, we no longer have access to this laboratory, or even to the paper prints. In such cases, using a flatbed scanner to digitize the negatives may be a solution. However, it does have its drawbacks, as we will see in the next episode. Until then, take care!

issue157/krita.1591942702.txt.gz · Dernière modification : 2020/06/12 08:18 de d52fr