Darken Modes

Done using GIMP 2.10.24 on Kubuntu Linux 20.04 LTS

Just as there were a number of Lighten modes, there are the opposites, the Darken modes. And in many ways they are just the reverse of the Lighten modes.

Darken Only

This is the opposite of Lighten Only. In this case, GIMP goes pixel by pixel through the two images and always selects the darkest color in each channel for the final image. The formula for this is:

GIMP Darken Only formula
GIMP Darken Only formula

Again, you might hear people say that it is selecting the darkest pixel, but that is not quite correct. You need to look at the color channels individually to understand what is going on. To see this, we’ll use the Red and Blue squares again like we did for the Lighten Only mode.

Red Layer
Red Layer
Blue Layer
Blue Layer

Now, when we mixed these two layers using Lighten Only, we got a Magenta layer, and that probably made intuitive sense since Magenta is a combination of blue and red. But mix them using Darken Only, and you get black square:

Resulting Black Image
Resulting Black Image

If this surprised you, let’s take a look at what is happening in each channel. The Red channel for the Red layer has a value of ff, whereas the Red channel for the Blue layer has a value of 00. Which of these is lower? The 00, obviously. Then for the Green channel, both layers have 00, so the result is 00. Finally for the Blue Channel, the values are 00 for the Red layer, and ff for the Blue layer. Again, the lower value is 00. The final image has pixel values of 000000 in each pixel, and of course that is pure black. Now, to be fair in a lot of cases it doesn’t make a big difference whether you think in terms of “the darkest pixel” instead of “the darkest channel value”, but in edge cases it will make a difference, and I think it is important if you are going to master digital graphics that you understand how digital color works in RGB space. You always have to analyze each channel of each pixel to get a full understanding, and mixing colors digitally can be very different from mixing paint in pots. Your intuition may let you down.

When we use this with our two images, the Dog image, which is darker, tends to predominate the resulting image. But because there is white in the right-hand side of both images, we get a little white in the final result. And because there are highlights in the dog image that are lighter, a little of the toy image comes through in those places.

Our two images combined with the Darken Only mode.
Our two images combined with the Darken Only mode.

This mode is of course commutative, so the order of the layers does not matter.

Luma/Luminance Darken Only

This is very similar to the Luma/Luminance Lighten Only, except of course opposite to it. Again, the key difference is that Luma/Luminance works on how the human eye perceives colors and brightness, rather than how an instrument might measure them. I did a more complete explanation in the Lighten section of the mathematics of this, so I won’t repeat all of it here. Go back and re-read that if you want all of the details. When I did a combined image using the Luma/Luminance Darken Only mode, I got this:

Combined images with Luma/Luminance Darken Only mode
Combined images with Luma/Luminance Darken Only mode

Now, to be honest my eyes cannot see a difference between these two images. I know there is a difference, though, because the file sizes are slightly different. I export my images from GIMP using Portable Network Graphics format, or PNG, which I tend to use because it has some great features. First, it is a raster graphics format, which makes it ideal for GIMP images, which are also raster graphics. Second, it has lossless compression, which makes it superior to JPG (or JPEG), which uses lossy compression. It also is better then JPG by incorporating an Alpha channel for transparency, which as you have seen we use a lot in GIMP. And unlike GIF, the compression is well-suited to photographs, and is not encumbered by any patents. For all of these reasons, I consider PNG to be the superior format for digital images. Now, in many cases I may be starting with a JPG image, which has undoubtedly lost some of its information already, but working in PNG means I won’t lose any more information as I go. JPG is the standard format for digital photography because it produces small file sizes without losing too much information, so when you are taking holiday snaps you are less likely to run out of space for photos, but if you were a professional or a dedicated hobbyist you would invest in larger storage and shoot RAW images. These are minimally processed “images” that store the data as the sensor collected it. They aren’t images, yet, but have to be processed to become images. They are sometimes called “digital negatives” for that reason, but it is a case of the analogy breaking down. Suffice it to say that RAW images give you the highest achievable quality in a digital photograph. BTW, GIMP cannot open RAW images directly, but you can use Darktable in conjunction in GIMP via a plugin, and we will probably get to that topic later.

OK, back to our image. I used the same method to compare the two images from Darken Only mode and Luma/Luminance Darken Only mode. I loaded both into GIMP and used the Difference Layer mode, and got this result:

Difference between resulting images
Difference between resulting images

So, not a lot of difference, but you can see the Blue streaks where there is a difference. So subtle, but there is something there.

Multiply

The formula for this Layer mode is:

Formula for Multiply mode
Formula for Multiply mode

This is another commutative mode, so the order of the layers does not matter. The value is computed for each channel (RGB), so if we take a look at our old Red and Blue layers and combine them using multiply, what do we get? The Red layer will have ff for the Red channel, and the Blue layer will have 00 for that channel, or in base 10 numbers, the Red layer is 255 and the Blue layer is 0. 0 x 255 is 0, so the resulting value is 0. Green channel is 0x0, which is zero, and Blue channel is 0x255, which is zero. But take a different set of numbers. Suppose the value in one image is 150, and the other is 150 as well. Multiply those together, and you get 22,500. Now divide by 255, and you get just over 88, which is just a bit over half of the two original values, making it roughly twice as dark.. So you can see that the net effect is to darken.

Looking at our two images when combined using Multiply, we get:

Images combined using Multiply
Images combined using Multiply

You can see that this is over all darker than the previous two modes, though there are still some lighter spots, such as white along the right-hand side.

Linear Burn

This is similar to Multiply, but instead of multiplying you are adding and subtracting, hence the linear. This is not yet documented, but according to Mike Davies the formula involves adding the two values together and subtracting 255 from the result. I would assume negative numbers are not allowed, so the minimum result would be 0, so that two fairly small values would combine to be zero, and two fairly dark pixels would combine to be black. Using our Red and Blue squares as examples, the Red channel would be 255+0-255=0, the green channel would be 0+0-255=0 (lowest permitted value,), and the Blue channel would be 0+255-255=0, so the resulting image would again be pure black.

Looking at our two images, we see that this produces more pure black than any other of the Darken modes, which makes sense when you look at the formula.

The formula is going to give us more zeros than any other of the modes, because the formula is linear instead of geometric.

The other Darken mode, Burn, was covered in the previous tutorial so I won’t repeat it here. But in a little tidbit, let me mention that Dodge and Burn are originally darkroom techniques from film photography. When making a print from a film negative, you would shine light through the negative to expose the print film. But you could use masking to alter the exposure. If you wanted something to be darker in the print, you would mask off everything except that area for part of the exposure, thus over-exposing, or darkening, that section. This was called a burn, and that makes sense. Dodge is just the opposite. During the print exposure, you would block off a section to make it lighter. GIMP and other digital graphics programs emulate this technique in software.

 Save as PDF