Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
v1.2 Layer Modes
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.
|Stacking layers simply.|
|Darkening or shading.|
|Lightening or highlighting.|
|Combining bright and dark parts of both layers.|
|Inverting the top image.|
|Changing hue, saturation, or brightness.|
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.
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” 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” mode is similar to loading two slides into a projector, then projecting the combined result.
“Screen” mode is like shining two separate slide projectors onto a screen simultaneously. This is the inverse of Multiply.
The backdrop is overlaid with the top layer, preserving the backdrop's highlights and shadows. This mode is the inverse of Hard Light.
The top layer is used where it is darker than the backdrop.
The top layer is used where it is lighter than the backdrop.
“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” 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” mode is similar to shining a harsh spotlight onto the backdrop.
“Soft Light” mode is somewhat like shining a diffuse spotlight onto the backdrop.
“Difference” mode subtracts the darker colour from the lighter of the two.
“Exclusion” mode is similar to Difference, but lower in contrast.
“Plus” mode adds together the layer and its backdrop.
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.
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” mode combines the hue of the top layer with the saturation and luminosity of the backdrop.
“Saturation” mode combines the saturation of the top layer's colours with the hue and luminosity of the backdrop.
“Color” mode combines the hue and saturation of the top layer with the luminosity of the backdrop.
“Luminosity” mode combines the luminosity of the top layer with the hue and saturation of the backdrop.
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” uses the backdrop only where the top layer covers it. Everything else is ignored.
“Destination Out” uses the backdrop only where the top layer doesn't cover it. Everything else is ignored.
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.
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.