The Kirikiri layer can be displayed in various composite modes (layer types).
The following compositing modes are available, and layer type constants starting with lt can be specified in the
Layer.type property.
In the formula,
result is the result,
dest is the luminance of the image to be superimposed,
src is the luminance of the image to be superimposed,
α is the alpha value for each pixel of the image to be superimposed, and the range of all values is 0.0 to 1.0.
In addition, the following functions are defined here for explanation.
- abs(a) : Absolute value of a
- max(a, b) : a and b, whichever is greater
- min(a, b) : a and b, whichever is lesser
- blend(a, b, r) = a (1.0 - r) + b r
- ltOpaque (ltCoverRect)
- ltOpaque is a display without transparency. The entire rectangle of the layer is always fully opaque (not limited to this layer type, but if Layer.opacity is used to reduce opacity).
Formula: result = src
Note
The same is true for ltCoverRect, but it is an older name before 2.23 beta 2.
- ltAlpha (ltTransparent)
- ltAlpha performs alpha compositing. This is the most basic type when performing transmission. The following equation is also used for alpha channel input from BMP and Susie plug-in.
Formula: result = blend(dest, src, α)
Note
ltTransparent has the same meaning, but is an older name before 2.23 beta 2.
- ltAddAlpha
- ltAddAlpha performs additive alpha compositing.
Image format converter can output images suitable for this format. You can also convert from ltAlpha to this format with the Layer.convertType method.
The ltAddAlpha layer will not display properly if it is a direct child of the ltAlpha layer.
Formula: result = min(1.0, dest ( 1.0 - α ) + src)
- ltAdditive
- ltAdditive performs additive composition. Suitable for expressing glow. Dodge (linear) in Photoshop, but if you want to get the same effect as Photoshop, use ltPsAdditive described later. Unlike ltPsAdditive, α is ignored in ltAdditive.
Neutral colors (colors that do not change when superimposed) are black.
Formula: result = min(1.0, dest + src)
- ltSubtractive
- ltSubtractive performs subtractive composition. α is ignored.
Neutral color is white.
Formula: result = max(0.0, dest + src - 1.0)
Note
The only difference from
result =
dest -
src is whether src is inverted or not.
- ltMultiplicative
- ltMultiplicative performs multiplicative synthesis. α is ignored.
Neutral color is white.
Formula result = dest src
- ltDodge
- ltDodge performs "dodging" compositing. Suitable for expressing objects illuminated by light. α is ignored.
Neutral color is black.
Formula: result = min(1.0, dest ( 1.0 - src ) )
- ltLighten
- ltLighten performs "comparison (light)" synthesis. α is ignored.
Neutral color is black.
Formula: result = max(dest, src)
- ltDarken
- ltDarken performs a "compare (dark)" synthesis. α is ignored.
Neutral color is white.
Formula: result = min(dest, src)
- ltScreen
- ltLighten performs "screen multiplication" synthesis. α is ignored.
Neutral color is black.
Formula: result = 1.0 - ( 1.0 - dest ) ( 1.0 - src )
- ltPsNormal
- ltPsNormal has the same effect as ltAlpha. For historical reasons, it has a different routine and name than ltAlpha.
- ltPsAdditive
- ltPsAdditive performs Photoshop-compatible "dodging (linear)" synthesis (additional synthesis). Unlike ltAdditive, α is not ignored.
Neutral color is black.
Formula: result = blend(dest, min(1.0, dest + src), α)
- ltPsSubtractive
- ltPsSubtractive performs Photoshop-compatible "burn-in (linear)" synthesis (subtraction synthesis). Unlike ltSubtractive, α is not ignored.
Neutral color is white.
Formula: result = blend(dest, max(0.0, dest + src - 1.0), α)
- ltPsMultiplicative
- ltPsMultiplicative provides Photoshop compatible "multiply" compositing. Unlike ltMultiplicative, α is not ignored.
Neutral color is white.
Formula: result = blend(dest, dest src, α)
- ltPsScreen
- ltPsScreen provides Photoshop compatible "screen" compositing. Unlike ltScreen, α is not ignored.
Neutral color is black.
Formula: result = blend(dest, 1.0 - (1.0 - dest) (1.0 - src), α)
- ltPsOverlay
- ltPsOverlay provides Photoshop compatible "overlay" compositing.
Neutral color is 50% gray.
Formula: result = blend(dest, overlay(dest, src), α)
Where overlay(a, b) =
a b 2.0 ( When a < 0.5 )
1.0 - (1.0 - a) (1.0 - b) 2.0 (At other times)
- ltPsHardLight
- ltPsHardLight provides Photoshop compatible "hard light" compositing.
Neutral color is 50% gray.
Formula: result = blend(dest, hardlight(dest, src), α)
Where hardlight(a, b) =
a b 2.0 ( When b < 0.5 )
1.0 - (1.0 - a) (1.0 - b) 2.0 (At other times)
- ltPsSoftLight
- ltPsSoftLight provides Photoshop compatible "soft light" compositing.
Neutral color is 50% gray.
Formula: result = blend(dest, softlight(dest, src), α)
When softlight(a, b) =
a(0.5 b) ( When b > 0.5 )
a((1.0 - b) 2) (At other times)
- ltPsColorDodge
- ltPsColorDodge provides Photoshop compatible "dodge color" compositing. Unlike ltDodge, α is not ignored.
Neutral color is black.
Formula: result = blend(dest, min(1.0, dest ( 1.0 - src ) ), α)
- ltPsColorDodge5
- ltPsColorDodge provides "dodging color" compositing compatible with Photoshop versions 5.x and below. The formula is slightly different from ltPsColorDodge.
Neutral color is black.
Formula: result = min(1.0, dest ( 1.0 - src α) )
- ltPsColorBurn
- ltPsColorBurn provides Photoshop compatible "burn-in color" compositing.
Neutral color is white.
Formula: result = blend(dest, max(0.0, 1.0 - (1.0 - dest) src), α)
- ltPsLighten
- ltPsLighten performs Photoshop-compatible "comparison (light)" compositing. Unlike ltLighten, α is not ignored.
Neutral color is black.
Formula: result = blend(dest, max(dest, src), α)
- ltPsDarken
- ltPsDarken performs Photoshop-compatible "compare (dark)" compositing. Unlike ltDarken, α is not ignored.
Neutral color is white.
Formula: result = blend(dest, min(dest, src), α)
- ltPsDifference
- ltPsDifference provides Photoshop compatible "absolute difference" compositing.
Neutral color is black.
Formula: result = blend(dest, abs(dest - src), α)
- ltPsDifference5
- ltPsDifference5 provides "absolute difference" compositing compatible with Photoshop versions 5.x and below. The formula is slightly different from ltPsDifference.
Neutral color is black.
Formula: result = abs(dest - src α)
- ltPsExclusion
- ltPsExclusion performs Photoshop-compatible "exclusion" compositing.
Neutral color is black.
Formula: result = blend(dest, dest + src - 2.0 src dest, α)