Layer Mask attribute¶
- class Mask¶
If specified, this attribute will define a bump mask. This value can only be 1
layer
with an optionalinvert
attribute. Any transparent part of themask
layer will be removed from the currentlayer
for which themask
is defined.This attribute that can be used as a cropping mechanism.
Meaning of a mask layer’s Size and Offset
Where “current layer” is the layer in which the
mask
attribute is set:- invert : bool¶
Use this
bool
attribute to cause the mask layer’s transparency to become inverted. This is only useful if excluding pixels from the layer’s image is desired.layers: - background: { color: '#4051B2' } # this red background is drawn to prove the transparency of the mask - background: { color: red } offset: { x: 600 } - size: { width: 200, height: 200 } offset: { x: 500, y: 215 } rectangle: color: green radius: 50 mask: invert: true size: { width: 150, height: 150 } offset: { x: 25, y: 25 } icon: { image: 'sphinx_logo' }