BlendingInCanvas

From Effects Task Force
Jump to: navigation, search

Specifying Compositing and Blending in Canvas

These keywords are only here to start a discussion.

Specifying the current compositing and blending mode

The Canvas [1] specification already defines the Porter-Duff operators. To allow blending, we can extend the list with the blending keywords:

normal, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color and luminosity.

If a blend mode is specified, the blended image is calculated as specified in the blending spec [2] and is then always composited to the destination with the src-over compositing operator.
Isolation and knockout do not apply in a canvas context since there is no concept of grouping.

or

The Canvas specification already defines the Porter-Duff operators.
To allow blending, we can add a new operator 'globalBlendOperation'[3] on the 2D context with the blending keywords:

normal, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color and luminosity.

The default value will be 'normal'.

Blending is done first, followed by compositing.

Specifying the shadow's compositing and blending mode

Introduce 2 new keywords that allow compositing and blending on the shadow color:
shadow-alpha-compositing would set the compositing mode of the shadow (the default would be 'src-over'/'normal')
shadow-blend-mode would set the blend operation on the shadow (the default is 'normal').