3. Legacy Layer Modes

Since GIMP 2.10 layer modes have changed. The old perceptual layer modes are still available for backwards compatibility. They are called legacy layer modes. These legacy layer modes will be used when loading images made before the introduction of the new, mostly linear, layer modes.

For more information on layer modes in general, see the default Layer Modes.

Figur 8.47. Selecting legacy layer mode

Selecting legacy layer mode

The Layers Dialog showing the Selecting legacy layer mode drop-down.


If you need to stay compatible with older GIMP versions or you need to use the legacy layer modes for other reasons, select the icon next to the Mode drop-down and change the setting from Default to Legacy mode. The Mode drop-down will now only show legacy layer modes. All modes will have (legacy) behind their name (the selected mode will use the short version (l)).

Figur 8.48. Images (masks) used for the layer mode examples

Images (masks) used for the layer mode examples

Mask 1

Images (masks) used for the layer mode examples

Mask 2 (note: this image is not the actual mask used, but a screenshot of the mask with the checkerboard pattern showing the transparent parts in GIMP)


Figur 8.49. Images (backgrounds) used for the layer mode examples

Images (backgrounds) used for the layer mode examples

Nyckelring

Images (backgrounds) used for the layer mode examples

Ankor


In the descriptions of the layer modes below, the equations are also shown. This is for those who are curious about the mathematics of the layer modes. You do not need to understand the equations in order to use the layer modes.

Ekvationerna är noterade förkortat. Till exempel betyder ekvationen

Ekvation 8.1. Exempel


means, For each pixel in the upper (Mask) and lower (Image) layer, add each of the corresponding color components together to form the E resulting pixel's color. Pixel color components must always be between 0 and 255.

[Notera] Notera

Såvida inte beskrivet annat sätts en negativ färgkomponent till 0 och en färgkomponent som är större än 255 sätts till 255.

The examples below show the effects of each of the legacy modes. Note that for simplicity we will omit (legacy) when mentioning the layer modes here.

Eftersom resultaten av varje läge varierar stort beroende på färgerna på lagren kan dessa bilder bara ge dig en allmän uppfattning om hur lägena fungerar. Vi uppmuntrar dig att prova själv. Du kan börja med två likartade lager, där ett är en kopia av det andra men något modifierat (genom att göras oskarpt, flyttas, roteras, skalas, färginverteras o.s.v.) och se efter vad som händer med lagerlägena.

Normal Layer Modes

Normal

In this group, only Normal is normal.

Figur 8.50. Exempel för lagerläget Normal

Exempel för lagerläget ”Normal”

Båda bilder är tonade i varandra med samma intensitet.

Exempel för lagerläget ”Normal”

Med 100% opacitet visas endast det övre lagret när det tonas med Normal.


Normal mode is the default layer mode. The layer on top covers the layers below it. If you want to see anything below the top layer when you use this mode, the layer must have some transparent areas.

Ekvationen är:

Ekvation 8.2. Ekvation för lagerläget Normal


Lös upp

Figur 8.51. Exempel för lagerläget Lös upp

Exempel för lagerläget ”Lös upp”

Båda bilder är tonade i varandra med samma intensitet.

Exempel för lagerläget ”Lös upp”

Med 100% opacitet visas endast det övre lagret när det tonas med lös upp.


Dissolve mode dissolves the upper layer into the layer beneath it by drawing a random pattern of pixels in areas of partial transparency. It is useful as a layer mode, but it is also often useful as a painting mode.

This is especially visible along the edges within an image. It is easiest to see in an enlarged screenshot. The image on the left illustrates Normal layer mode (enlarged) and the image on the right shows the same two layers in Dissolve mode, where it can be clearly seen how the pixels are dispersed.

Figur 8.52. Förstorade skärmbilder

Förstorade skärmbilder

Normalläge

Förstorade skärmbilder

Lös upp-läge


Lighten Layer Modes

Gör endast ljusare

Figur 8.53. Exempel för lagerläget Gör endast ljusare

Exempel för lagerläget ”Gör endast ljusare”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Gör endast ljusare”

Mask 2 används som det övre lagret med 100% opacitet.


Lighten only mode compares each component of each pixel in the upper layer with the corresponding one in the lower layer and uses the larger value in the resulting image. Completely black layers have no effect on the final image and completely white layers result in a white image.

Ekvationen är:

Ekvation 8.3. Ekvation för lagerläget Gör endast ljusare


The mode is commutative; the order of the two layers doesn't matter.

Skärm

Figur 8.54. Exempel för lagerläget Skärm

Exempel för lagerläget ”Skärm”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Skärm”

Mask 2 används som det övre lagret med 100% opacitet.


Screen mode inverts the values of each of the visible pixels in the two layers of the image. (That is, it subtracts each of them from 255.) Then it multiplies them together, divides by 255 and inverts this value again. The resulting image is usually brighter, and sometimes washed out in appearance. The exceptions to this are a black layer, which does not change the other layer, and a white layer, which results in a white image. Darker colors in the image appear to be more transparent.

Ekvationen är:

Ekvation 8.4. Ekvation för lagerläget Skärm


The mode is commutative; the order of the two layers doesn't matter.

Skugga

Figur 8.55. Exempel för lagerläget Skugga

Exempel för lagerläget ”Skugga”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Skugga”

Mask 2 används som det övre lagret med 100% opacitet.


Dodge mode multiplies the pixel value of the lower layer by 256, then divides that by the inverse of the pixel value of the top layer. The resulting image is usually lighter, but some colors may be inverted.

In photography, dodging is a technique used in a darkroom to decrease the exposure in particular areas of the image. This brings out details in the shadows. When used for this purpose, dodge may work best on Grayscale images and with a painting tool, rather than as a layer mode.

Ekvationen är:

Ekvation 8.5. Ekvation för lagerläget Skugga


Addition

Figur 8.56. Exempel för lagerläget Addition

Exempel för lagerläget ”Addition”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Addition”

Mask 2 används som det övre lagret med 100% opacitet.


Addition-läget är väldigt enkelt. Bildpunktsvärden i övre och nedre lagret adderas med varann. Slutbilden blir vanligtvis ljusare. Ekvationen kan resultera i färgvärden större än 255, så några av de ljusaste färgerna kan bli satta till maxvärdet 255.

Ekvationen är:

Ekvation 8.6. Ekvation för lagerläget Addition


The mode is commutative; the order of the two layers doesn't matter.

Darken Layer Modes

Gör endast mörkare

Figur 8.57. Exempel för lagerläget Gör endast mörkare

Exempel för lagerläget ”Gör endast mörkare”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Gör endast mörkare”

Mask 2 används som det övre lagret med 100% opacitet.


Darken only mode compares each component of each pixel in the upper layer with the corresponding one in the lower layer and uses the smaller value in the resulting image. Completely white layers have no effect on the final image and completely black layers result in a black image.

Ekvationen är:

Ekvation 8.7. Ekvation för lagerläget Gör endast mörkare


The mode is commutative; the order of the two layers doesn't matter.

Multiplicera

Figur 8.58. Exempel för lagerläget Multiplicera

Exempel för lagerläget ”Multiplicera”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Multiplicera”

Mask 2 används som det övre lagret med 100% opacitet.


Multiply mode multiplies the pixel values of the upper layer with those of the layer below it and then divides the result by 255. The result is usually a darker image. If either layer is white, the resulting image is the same as the other layer (1 * I = I). If either layer is black, the resulting image is completely black (0 * I = 0).

Ekvationen är:

Ekvation 8.8. Ekvation för lagerläget Multiplicera


The mode is commutative; the order of the two layers doesn't matter.

Efterbelys

Figur 8.59. Exempel för lagerläget Efterbelys

Exempel för lagerläget ”Efterbelys”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Efterbelys”

Mask 2 används som det övre lagret med 100% opacitet.


Burn mode inverts the pixel value of the lower layer, multiplies it by 256, divides that by one plus the pixel value of the upper layer, then inverts the result. It tends to make the image darker, somewhat similar to Multiply mode.

In photography, burning is a technique used in a darkroom to increase the exposure in particular areas of the image. This brings out details in the highlights. When used for this purpose, burn may work best on Grayscale images and with a painting tool, rather than as a layer mode.

Ekvationen är:

Ekvation 8.9. Ekvation för lagerläget Efterbelys


Contrast Layer Modes

Överlagring

Figur 8.60. Exempel för lagerläget Överlagring

Exempel för lagerläget ”Överlagring”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Överlagring”

Mask 2 används som det övre lagret med 100% opacitet.


Overlay mode in theory inverts the pixel value of the lower layer, multiplies it by two times the pixel value of the upper layer, adds that to the original pixel value of the lower layer, divides by 255, and then multiplies by the pixel value of the original lower layer and divides by 255 again.

Due to a bug [4] the actual equation is equivalent to Soft light. This will not be fixed for the legacy layer mode. However, even if you explicitly use legacy layer mode, GIMP will still set the default Overlay layer mode. Images that have the legacy Overlay mode set for a layer, will have that changed to legacy Soft light, since that's what it effectively is.

Mjukt ljus

Figur 8.61. Exempel för lagerläget Mjukt ljus

Exempel för lagerläget ”Mjukt ljus”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Mjukt ljus”

Mask 2 används som det övre lagret med 100% opacitet.


Soft light is not related to Hard light in anything but the name, but it does tend to make the edges softer and the colors not so bright. It is similar to Overlay mode. In some versions of GIMP, Overlay mode and Soft light mode are identical.

The equation is complicated. It needs Rs, the result of Screen mode:

Ekvation 8.10. Ekvation för lagerläget Skärm


Ekvation 8.11. Ekvation för lagerläget Mjukt ljus


Hårt ljus

Figur 8.62. Exempel för lagerläget Hårt ljus

Exempel för lagerläget ”Hårt ljus”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Hårt ljus”

Mask 2 används som det övre lagret med 100% opacitet.


Hard light mode is rather complicated because the equation consists of two parts, one for darker colors and one for brighter colors. If the pixel color of the upper layer is greater than 128, the layers are combined according to the first formula shown below. Otherwise, the pixel values of the upper and lower layers are multiplied together and multiplied by two, then divided by 256. You might use this mode to combine two photographs and obtain bright colors and sharp edges.

Denna ekvation är komplex och skiljer sig om värdet är > 128 eller < 128:

Ekvation 8.12. Ekvation för lagerläget Hårt ljus, M > 128


Ekvation 8.13. Ekvation för lagerläget Hårt ljus, M < 128


Inversion Layer Modes

Differens

Figur 8.63. Exempel för lagerläget Differens

Exempel för lagerläget ”Differens”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Differens”

Mask 2 används som det övre lagret med 100% opacitet.


Differens-läget subtraherar bildpunktsvärdet från det övre lagret från det i nedre lagret och tar sedan absolutbeloppet av resultatet. Oavsett hur de ursprungliga två lagren ser ut kommer resultat bli ganska udda. Du kan använda detta för invertera element i en bild.

Ekvationen är:

Ekvation 8.14. Ekvation för lagerläget Differens


The mode is commutative; the order of the two layers doesn't matter.

Subtraktion

Figur 8.64. Exempel för lagerläget Subtraktion

Exempel för lagerläget ”Subtraktion”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Subtraktion”

Mask 2 används som det övre lagret med 100% opacitet.


Subtract mode subtracts the pixel values of the upper layer from the pixel values of the lower layer. The resulting image is normally darker. You might get a lot of black or near-black in the resulting image. The equation can result in negative color values, so some of the dark colors may be set to the minimum value of 0.

Ekvationen är:

Ekvation 8.15. Ekvation för lagerläget Subtraktion


Grynextrahering

Figur 8.65. Exempel för lagerläget Grynextrahering

Exempel för lagerläget ”Grynextrahering”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Grynextrahering”

Mask 2 används som det övre lagret med 100% opacitet.


Grain extract mode is supposed to extract the film grain from a layer to produce a new layer that is pure grain, but it can also be useful for giving images an embossed appearance. It subtracts the pixel value of the upper layer from that of the lower layer and adds 128.

Ekvationen är:

Ekvation 8.16. Ekvation för lagerläget Grynextrahering


Grynsammanfogning

Figur 8.66. Exempel för lagerläget Grynsammanfogning

Exempel för lagerläget ”Grynsammanfogning”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Grynsammanfogning”

Mask 2 används som det övre lagret med 100% opacitet.


Grain merge mode merges a grain layer (possibly one created from the Grain extract mode) into the current layer, leaving a grainy version of the original layer. It does just the opposite of Grain extract. It adds the pixel values of the upper and lower layers together and subtracts 128.

Ekvationen är:

Ekvation 8.17. Ekvation för lagerläget Grynsammanfogning


Dividera

Figur 8.67. Exempel för lagerläget Dividera

Exempel för lagerläget ”Dividera”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”Dividera”

Mask 2 används som det övre lagret med 100% opacitet.


Divide mode multiplies each pixel value in the lower layer by 256 and then divides that by the corresponding pixel value of the upper layer plus one. (Adding one to the denominator avoids dividing by zero.) The resulting image is often lighter, and sometimes looks burned out.

Ekvationen är:

Ekvation 8.18. Ekvation för lagerläget Dividera


HSV Components Layer Modes

NMI-nyans

Figur 8.68. Exempel för lagerläget NMI-nyans

Exempel för lagerläget ”NMI-nyans”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”NMI-nyans”

Mask 2 används som det övre lagret med 100% opacitet.


HSV Hue mode uses the Hue of the upper layer and the Saturation and Value of the lower layer to form the resulting image. However, if the Saturation of the upper layer is zero, the Hue is taken from the lower layer, too.

NMI-mättnad

Figur 8.69. Exempel för lagerläget NMI-mättnad

Exempel för lagerläget ”NMI-mättnad”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”NMI-mättnad”

Mask 2 används som det övre lagret med 100% opacitet.


HSV Saturation mode uses the Saturation of the upper layer and the Hue and Value of the lower layer to form the resulting image.

HSL-färg

Figur 8.70. Exempel för lagerläget HSL-färg

Exempel för lagerläget ”HSL-färg”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”HSL-färg”

Mask 2 används som det övre lagret med 100% opacitet.


HSL Color mode uses the Hue and Saturation of the upper layer and the Lightness of the lower layer to form the resulting image.

NMI-intensitet

Figur 8.71. Exempel för lagerläget NMI-intensitet

Exempel för lagerläget ”NMI-intensitet”

Mask 1 används som det övre lagret med 100% opacitet.

Exempel för lagerläget ”NMI-intensitet”

Mask 2 används som det övre lagret med 100% opacitet.


HSV Value mode uses the Value of the upper layer and the Saturation and Hue of the lower layer to form the resulting image. You can use this mode to reveal details in dark and light areas of an image without changing the Saturation.



[4] See the old Bugzilla issue tracker: issue #162395.