Lighten Layer Modes

Done using GIMP 2.10.24 on Kubuntu Linux 20.04 LTS

Lighten Only

Lighten only looks at each component of each pixel in both the top and bottom layers, and always selects the largest value for the combination. This means that it will always at the very least lighten since larger numbers are lighter. In RGB space, pure black is 000000, and pure white is ffffff. Each component is a two-digit hexadecimal number, where the first two digits are red, the next two are green, and the last two are blue. So as an example, if you had a pure red layer (ff0000) and a pure blue layer (0000ff) and you combined them using Lighten Only, the result would be an image where each pixel was ff00ff, and that is magenta, the combination of red and blue.

A pure red image on a layer
A pure blue image on a layer
A pure magenta image from combining layers using Lighten Only

If you then took a copy of the magenta image, and added a pure green layer (00ff00) using the Lighten Only mode, you would get a pure white image. The point of all of this is to focus on the components. I have seen people say that Lighten Only mode selects the lightest pixel from each layer, but that is not correct. In fact you cannot talk meaningfully about pixel lightness separate from the lightness of each component. But in most cases it will look like it is selecting pixel brightness. You would need to do some analysis to see what difference it might make.

Now, the interesting thing is what happens when you are using images with some content. Using our images of the dog and the toy, with Lighten Only we get a bit of the dog coming through because the side of the dog’s head is in sunlight, and is lighter than the shadowed side of the toy. And because the crystal ball is so dark you see a bit of the dog come through in there as well, even though that part of the dog’s head is in shadow in the image.

Two images combined using Lighten Only
Two images combined using Lighten Only

It is worth noting that for Lighten Only, the mode is commutative, meaning that the order of the layers does not matter. For many layer modes it does matter which is on top, and which on the bottom, but not here.

Luma/Luminance Lighten Only

Both Luma and Luminance are measures of brightness, the difference appearing to be whether one measures it in black-and-white or in color. The invaluable Wikipedia comes to our aid here, which is good because the documentation in GIMP is missing at this point.

In videoluma represents the brightness in an image (the “black-and-white” or achromatic portion of the image). Luma is typically paired with chrominance. Luma represents the achromatic image, while the chroma components represent the color information. Converting R′G′B′ sources (such as the output of a three-CCD camera) into luma and chroma allows for chroma subsampling: because human vision has finer spatial sensitivity to luminance (“black and white”) differences than chromatic differences, video systems can store and transmit chromatic information at lower resolution, optimizing perceived detail at a particular bandwidth.

Luminance is instead a weighted average of the RGB values:

While luma is more often encountered, relative luminance is sometimes used in video engineering when referring to the brightness of a monitor. The formula used to calculate relative luminance uses coefficients based on the CIE color matching functions and the relevant standard chromaticities of red, green, and blue (e.g., the original NTSC primaries, SMPTE C, or Rec. 709). For the Rec. 709 (and sRGB) primaries, the linear combination, based on pure colorimetric considerations and the definition of relative luminance is:Y=0.2126R+0.7152G+0.0722B

The formula used to calculate luma in the Rec. 709 spec arbitrarily also uses these same coefficients, but with gamma-compressed components: Y’=0.2126R’+0.7152G’+0.0722B’, where the prime symbol ′ denotes gamma compression.

The last step is get an idea of what gamma compression is. I found a wonderful explanation on a blog post, WHAT EVERY CODER SHOULD KNOW ABOUT GAMMA, that makes it clear. The idea is that brightness is not perceived in a linear fashion, but instead follows a power relationship.

The 24-bit RGB colour model (RGB24) used on virtually all consumer level electronic devices uses 8-bit gamma encoded values per channel to represent light intensities. If you recall what we discussed earlier, this means that pixels with RGB(128, 128, 128) will not emit approximately 50% the light energy of pixels with RGB(255, 255, 255), but only about 22%! That makes perfect sense! Because of the non-linear nature of human vision, a light source needs to be attenuated to about 22% of its original light intensity to appear half as bright to humans. RGB(128, 128, 128) appears to be half as bright as RGB(255, 255, 255) to us! If you find this confusing, reflect a bit on it because it’s crucial to have a solid understanding of what has been discussed so far (trust me, it will only get more confusing).

Of course, gamma encoding is always done with the assumption that the image is ultimately meant to be viewed by humans on computer screens. In some way, you can think of it as a lossy MP3 like compression but for images. For other purposes (e.g. scientific analysis or images meant for further post-processing), using floats and sticking with the linear scale is often a much better choice, as we’ll later see.

So what this boils down to is that most computer monitors utilize gamma compressed (also called gamma corrected) values for displaying RGB colors, and that is a good thing for most purposes.

This makes for a small difference when using Luma/Luminance Lighten Only mode, since this mode will work with the perceived value of the color values rather than the absolute value of them. The main difference is that Luminance is taking into account the brightness of the color.

Two images combined using Luma/Luminance Lighten Only
Two images combined using Luma/Luminance Lighten Only

The two images look very similar, but using the Difference Layer Mode I can get an objective measure of the difference:

Two images compared to see different Layer Mode effects
Two images compared to see different Layer Mode effects

Here we can see that there is a difference. Anything black is identical in the two images, and since both had white backgrounds it makes sense that we are seeing a lot black in the Difference image. But where we see color other than black there is a difference.

Screen Mode

This has a documented formula (Yay!) but it may be a little complicated. Again, we are working with the RGB values, which range from 0 (black) to 255 (full color). The formula used for this mode is:

Formula for Screen Mode

E is the resulting pixel value, and to get there you invert the values you started with by subtracting them from 255. So if one image had a Red value of 104, it gets inverted as 255-104, or 151. Then do the same thing for the Red value in the other image, and then multiply those values. So if the second image had a Red value of 87, subtracting from 255 gives us 168. Multiplying them together we get 151*168, or 25,368. Then we divide by 255, giving us 99. And then we re-invert by subtracting this from 255 to get 146. Note that this value is higher, i.e. lighter value, than either of the starting values.

In essence, this mode will make darker colors fade more, and is useful for removing dark backgrounds. Also note that in this case the order of the layers does not matter, making this another commutative layer mode. And it will in general give a more washed-out appearance.

Two images combined with Screen Layer Mode
Two images combined with Screen Layer Mode

As you can see, the resulting image from using our usual two starting images is more washed out than in the earlier Lighten Only modes. But then I tried this mode using the image from the Luma/Luminance Layer Mode, and the dark image I got from using the Difference mode.

A dark and a light image combined using Screen
A dark and a light image combined using Screen

As you can see, the black background is completely gone.

Another interesting use of this mode can be seen in a Chris Parker tutorial, where he uses it to create a soft-glow effect for photography such as wedding photos. He duplicates the image, and then adds Gaussian Blur to the duplicate. Then he uses Screen mode to combine the two, and fine-tunes hte result using Opacity. You can see his tutorial on his YouTube channel.


The last of the Lighten modes for this tutorial is Addition, which is pretty straightforward. You simply add the values from the two images, but with a maximum of 255 for the resulting value since RGB values cannot go above 255. So if we had the values for Red as in the Screen example above (104 and 87 respectively), adding them would give us a value of 191. Since this is less than 255, we can keep this value. But suppose the values were 104 and 187 in the two input pictures? Then the total would be 291, and we would instead get a value of 255.

Two images combined using Addition Mode
Two images combined using Addition Mode

This is somewhat similar to the Screen mode in effect, but there are differences if you look closely at the two images, such as in the base of the globe, the wizard’s hat, and the wizard’s beard.

There is one more Lighten Mode, but that deserves a little more discussion as it is paired with a Darken mode, and also has a couple of tools doing similar things, so that will be our next tutorial.

 Save as PDF