JA EN

Mask

A mechanism that controls visibility of image regions using greyscale values. Layer masks enable non-destructive editing by hiding rather than deleting pixels.

A mask controls the visibility of specific image regions using greyscale values: white areas are fully visible, black areas are fully hidden, and grey areas are semi-transparent. Because the original pixel data remains intact, masks are the foundation of non-destructive editing workflows.

Key mask types in image editing:

In web development, CSS mask-image applies masks to HTML elements. Gradient masks create fade-out effects, while SVG paths enable complex shape clipping:

In image processing code, masks are implemented as binary or greyscale arrays of the same dimensions as the source image. OpenCV applies masks via bitwise operations: cv2.bitwise_and(img, img, mask=mask). This approach is fundamental to region-of-interest processing, selective filtering, and compositing pipelines.

Related Terms

Related Articles