v1.2 Layer Modes

Andrew Chadwick edited this page Jan 26, 2016 · 9 revisions
Clone this wiki locally

:book: Part of the v1.2 User Manual.

Supported Layer Modes

MyPaint supports the layer blending modes documented in the OpenRaster specification, version 0.0.5. These are useful combinations of the layer blending and compositing modes defined in the W3C Compositing and Blending Level 1 Editor’s Draft as of 2015-10-28.

A layer can be assigned one of these modes using the Layers Panel. The blending mode of a layer determines how its pixels combine with the pixels of its backdrop.

Comparison Chart

Purpose . .. ... ....
Stacking layers simply. Normal
Darkening or shading. Multiply Darken Burn
Lightening or highlighting. Screen Lighten Dodge Plus
Combining bright and dark parts of both layers. Overlay Hard Light Soft Light
Inverting the top image. Difference Exclusion
Changing hue, saturation, or brightness. Hue Saturation Color Luminosity
Masking areas. Destination In Destination Out Source Atop Destination Atop

Basic Modes

The basic blend modes combine the RGB pixels of the top layer with its backdrop to create some effect, then composite the result of the blending step over the backdrop using standard alpha compositing.

Normal

Preview of “Normal” mode

The “Normal” mode is the default. It combines the top layer with the one below it, without first changing any of the colors in the top layer, and using standard alpha compositing.

“Normal” mode can be applied to layer groups. It causes the group’s content to be calculated in isolation before the result is then composited onto the group’s backdrop.

Pass-through

(No preview)

“Pass-through” mode can only be applied to layer groups. Assigning pass-through mode to a group makes each layer within the group affect the group’s background.

Multiply

Example of “Multiply”

“Multiply” mode is similar to loading two slides into a projector, then projecting the combined result.

Screen

Example of “Screen”

“Screen” mode is like shining two separate slide projectors onto a screen simultaneously. This is the inverse of Multiply.

Overlay

Example of “Overlay”

The backdrop is overlaid with the top layer, preserving the backdrop's highlights and shadows. This mode is the inverse of Hard Light.

Darken

Example of “Darken”

The top layer is used where it is darker than the backdrop.

Lighten

Example of “Lighten”

The top layer is used where it is lighter than the backdrop.

Burn

Example of “Burn”

“Burn” mode darkens the backdrop using the top layer. The effect looks similar to the photographic darkroom technique of the same name, which is used for reducing over-bright highlights.

Dodge

Example of “Dodge”

“Dodge” mode brightens the backdrop using the top layer. The effect is similar to the photographic darkroom technique of the same name, which is used for improving contrast in shadows.

Hard Light

Example of “Hard Light”

“Hard Light” mode is similar to shining a harsh spotlight onto the backdrop.

Soft Light

Example of “Soft Light”

“Soft Light” mode is somewhat like shining a diffuse spotlight onto the backdrop.

Difference

Example of “Difference”

“Difference” mode subtracts the darker colour from the lighter of the two.

Exclusion

Example of “Exclusion”

“Exclusion” mode is similar to Difference, but lower in contrast.

Plus

Example of “Plus”

“Plus” mode adds together the layer and its backdrop.

Color-and-Brightness Modes

These layer modes let you change the colour of the backdrop or its brightness. They let you colourize a monochrome image, desaturate it, or tweak shadows and highlights.

These modes don’t operate on the usual red, green, and blue channels. They operate on hue, saturation, and luminosity channels instead. A pixel’s hue describes what colour it is, and its saturation measures how strong that colour is. Pixels also have luminosity, which is a measure of brightness. This trio describes a pixel in enough detail to work on. These modes blend new pixel trios from the top layer and its backdrop.

:bulb: The luminosity measure these modes use is quite relevant to the human eye. It's the same kind of brightness a television uses. MyPaint's HCY wheel uses the same system.

The results of the colour blend then get composited over the backdrop in the usual way. This means you can use the layer’s opacity to adjust the amount of change you see.

Hue

Example of “Hue”

“Hue” mode combines the hue of the top layer with the saturation and luminosity of the backdrop.

Saturation

Example of “Saturation”

“Saturation” mode combines the saturation of the top layer's colours with the hue and luminosity of the backdrop.

Color

Example of “Color”

“Color” mode combines the hue and saturation of the top layer with the luminosity of the backdrop.

Luminosity

Example of “Luminosity”

“Luminosity” mode combines the luminosity of the top layer with the hue and saturation of the backdrop.

Masking Modes

MyPaint v1.2.x has a primitive kind of layer mask. These can be built using separate mask layers, which are ordinary layers with a masking mode applied.

Masking modes implement a useful subset of the Porter-Duff compositing operators.

These primitive mask layers, and the layers they are applied to, should typically be placed inside a layer group, and these layer groups should use the default Normal mode.

Destination In

Example of “Destination In”

“Destination In” uses the backdrop only where the top layer covers it. Everything else is ignored.

Destination Out

Example of “Destination Out”

“Destination Out” uses the backdrop only where the top layer doesn't cover it. Everything else is ignored.

Source Atop

Example of “Source Atop”

Parts of the top layer which overlap the backdrop replace the backdrop image. The backdrop is used everywhere else, and the combined effect takes on the bottom layer's shape.

Destination Atop

Example of “Destination Atop”

Parts of the bottom layer which aren't overlapped by the top layer are used verbatim. The top layer is used everywhere else, and the combined effect takes on the top layer's shape.