The mask annotation renderer keeps compressed RLE masks semantic in detection
frames. BaseMaskStyle controls the visible fill, global opacity, outline, and
render mode while the browser package privately prepares efficient artifacts.
session.setPresentation({
renderers: [
annotationRenderers.mask({
style: new BaseMaskStyle({
fillAlpha: 1,
opacity: 0.72,
stroke: { alpha: 1, width: 2 },
}),
}),
],
});
opacity applies to the complete mask layer and can be updated cheaply.
fillAlpha is part of prepared fill styling and remains separate so an outline
can stay opaque.
See Detections And Rendering for the semantic-mask and prepared-artifact boundary.