Base SVG Filters Reference
Visual filters for base SVG layer Apply opacity, blur, brightness, and other effects to make overlays more prominent
Overview
Apply visual filters to the base SVG layer to make overlays more prominent while keeping overlays crisp and clear.
Quick Start
Apply a preset:
base_svg:
source: builtin:ncc-1701-a-blue
filter_preset: dimmedCustom filters:
base_svg:
source: builtin:ncc-1701-a-blue
filters:
opacity: 0.5
blur: "3px"Combine preset with overrides:
base_svg:
source: builtin:ncc-1701-a-blue
filter_preset: dimmed
filters:
opacity: 0.3 # Override preset's 0.5Filter Types
Opacity
Controls transparency of base SVG (0.0 = invisible, 1.0 = fully opaque).
filters:
opacity: 0.5 # 50% transparentUse cases: Dim background artwork to emphasize overlays.
Blur
Applies Gaussian blur (softens focus).
filters:
blur: "3px" # Moderate blurUse cases: Create depth, de-emphasize background detail.
Brightness
Adjusts brightness level (1.0 = normal, <1.0 = darker, >1.0 = brighter).
filters:
brightness: 0.7 # 30% darkerUse cases: Darken background, adjust visibility.
Contrast
Adjusts contrast (1.0 = normal, <1.0 = lower contrast, >1.0 = higher contrast).
filters:
contrast: 0.8 # Reduce contrastUse cases: Soften harsh edges, mute colors.
Grayscale
Converts to grayscale (0.0 = full color, 1.0 = completely gray).
filters:
grayscale: 0.5 # 50% desaturatedUse cases: Monochrome displays, reduced visual weight.
Sepia
Applies sepia tone (warm brown tint).
filters:
sepia: 0.3 # Slight warmthUse cases: Vintage aesthetic, warm backgrounds.
Hue Rotate
Rotates colors around the color wheel (in degrees).
filters:
hue_rotate: 45 # Shift hues by 45 degreesUse cases: Color theme adjustments, alert states.
Saturate
Adjusts color saturation (1.0 = normal, <1.0 = less saturated, >1.0 = more saturated).
filters:
saturate: 0.6 # Reduce saturationUse cases: Mute vibrant colors, adjust visual intensity.
Invert
Inverts colors (0.0 = normal, 1.0 = fully inverted).
filters:
invert: 0.2 # Slight inversionUse cases: High-contrast themes, special effects.
Built-in Presets
none
Clear all filters (remove filtering).
# No filters applied
filter_preset: noneBest for: Removing filters, returning to unfiltered state.
dimmed
Reduces opacity and brightness for subtle background.
# Equivalent to:
filters:
opacity: 0.5
brightness: 0.8Best for: General use, balanced visibility.
subtle
Light dimming with slight blur and desaturation.
# Equivalent to:
filters:
opacity: 0.6
blur: "1px"
grayscale: 0.2Best for: Maintaining detail while reducing emphasis.
backdrop
Heavy dimming with blur for strong overlay emphasis.
# Equivalent to:
filters:
opacity: 0.3
blur: "3px"
brightness: 0.6Best for: Data-heavy displays, prominent overlays.
faded
Desaturated and dimmed for muted background.
# Equivalent to:
filters:
opacity: 0.4
grayscale: 0.5
contrast: 0.7Best for: Minimal aesthetic, reduced visual clutter.
red-alert
Brightened with warm hue shift for alert state.
# Equivalent to:
filters:
opacity: 0.7
brightness: 1.2
hue_rotate: -30
saturate: 1.5Best for: Alert states, emergency displays.
monochrome
Full grayscale with enhanced contrast.
# Equivalent to:
filters:
grayscale: 1.0
contrast: 1.2
brightness: 0.9Best for: Professional displays, reduced color distraction.
Overlay-Only Mode
Create cards without any base SVG (pure overlay displays).
base_svg:
source: "none"
view_box: [0, 0, 1920, 1200] # REQUIRED when source is "none"
overlays:
- type: control
id: main_display
# ... overlay configRequirements:
view_boxmust be explicitly defined (4-element array)- No anchor extraction (all overlays need explicit coordinates)
Use cases:
- Pure data displays
- Custom overlay compositions
- Testing/prototyping
Theme Overrides
Themes can define custom filter presets.
Theme YAML:
lcars-custom:
name: "LCARS Custom"
msd:
filter_presets:
dimmed:
opacity: 0.3 # Override built-in 0.5
blur: "2px" # Add blur
custom-preset:
opacity: 0.4
grayscale: 0.8
contrast: 1.1Card Config:
theme: lcars-custom
base_svg:
source: builtin:ncc-1701-a-blue
filter_preset: dimmed # Uses theme overridePriority: Theme presets override built-in presets, explicit filters override everything.
Technical Details
Filter Isolation
Filters apply only to base SVG content, not to overlays. This is achieved by wrapping base SVG content in an internal group:
<svg viewBox="0 0 1920 1200">
<g id="__msd-base-content" style="filter: blur(3px)">
<!-- Base SVG ship template - FILTERED -->
</g>
<g id="msd-overlay-container">
<!-- Overlays - NOT filtered, remain crisp -->
</g>
</svg>Result: Base artwork is filtered while overlays remain sharp and clear.
Reserved IDs
IDs starting with __ (double underscore) or msd-internal- are reserved for internal MSD use:
__msd-base-content- Base SVG content wrapper (for filter isolation)- Not extracted as anchors
- Not validated as user anchors
- Invisible to anchor system
User anchors: Can use any ID except those starting with __ or msd-internal-.
Performance
- GPU-accelerated: CSS filters use hardware acceleration
- Single application: Filters applied once after initial render
- No overhead: No ongoing performance impact
- Optional transitions: CSS-based animations available