Masks & Effects

OpenGPEX supports non-destructive masking and adjustment effects that preserve original pixel data while enabling complex compositing workflows.


Non-Destructive Philosophy

All masking and effects in OpenGPEX are metadata operations — the original image is never modified:

Original Asset (CAS) → Layer Metadata (masks[], adjustments[]) → Rendered Output
                        ↑                                          ↑
                   Editable at any time                    Computed on-the-fly

Mask Types

Vector Masks (Shape-based)

Shape Description
Rectangle Rectangular reveal/hide region
Ellipse Circular/oval reveal region
Custom Path Freeform pen-tool paths (coming soon)

Bitmap Masks (Painted)

Created by painting with the Eraser tool — builds a grayscale alpha map:

  • White = fully visible
  • Black = fully hidden
  • Gray = partially transparent

Clip Masks

Attach a mask layer to a parent — the parent is only visible where the mask has content.


Mask Data Structure

interface MaskDescriptor {
  type: 'vector' | 'bitmap' | 'clip';
  shape?: LocalShape;     // For vector masks
  assetId?: string;       // For bitmap masks (grayscale image)
  inverted: boolean;      // Swap visible/hidden regions
}

Adjustment Layers

Non-destructive color and tone corrections:

Adjustment Parameters
Brightness/Contrast brightness: -100 to 100, contrast: -100 to 100
Hue/Saturation hue: -180 to 180, saturation: -100 to 100, lightness: -100 to 100
Levels shadows, midtones, highlights (input/output)
Color Balance shadows/midtones/highlights RGB shifts
Invert Full color inversion
Grayscale Desaturate with channel mixing

Applying Effects

// Add an adjustment layer above the target
actions.addLayers(frameId, [{
  type: 'adjustment',
  name: 'Brightness +20',
  adjustmentType: 'brightness-contrast',
  params: { brightness: 20, contrast: 0 },
}]);

Next Steps


Last updated: 2026-06-14