No Login Data Private Local Save

CSS Mask Image Generator - Online Reveal Effects

16
0
0
0
Mask Settings
Or drop / click to upload image


Live Preview
radial-gradient
Generated CSS

Copy and paste this CSS into your stylesheet. Works with any <div> that has a background image.

Frequently Asked Questions

CSS mask-image is a property that lets you use an image, gradient, or SVG as a mask layer to hide or reveal portions of an element. Similar to how alpha channels work in image editing, the mask's luminance determines visibility: black areas hide the element, white areas reveal it, and gray values create partial transparency. This tool generates mask-image CSS with proper -webkit- prefixes for cross-browser compatibility. Masking is GPU-accelerated in most modern browsers, making it performant for animations.

While both can hide parts of an element, they work differently. clip-path creates a hard vector-based crop with sharp edges and no soft transitions. mask-image supports alpha transparency, allowing smooth feathered edges, gradient fades, and soft vignette effects. Use clip-path for geometric crops with sharp boundaries, and mask-image for artistic reveals with soft edges, blur transitions, or luminance-based transparency effects.

CSS mask-image is supported in all modern browsers: Chrome 120+, Firefox 53+, Safari 15.4+, and Edge 120+. For older Safari and Chrome versions (pre-2023), the -webkit-mask-image prefix is required. This tool automatically generates both the standard and -webkit- prefixed versions to ensure maximum compatibility. As of 2024, global support exceeds 94% of web users. For IE11, consider using SVG masks as a fallback.

You can create custom SVG masks by defining a <mask> element in SVG and referencing it via mask-image: url(#mask-id), or inline the SVG as a data URI. For example, use an SVG <path> with any custom shape as the mask source. The key principle: white fill in the SVG = visible area, black = hidden. This tool generates inline SVG data URIs for heart, star, and diamond shapes so the CSS is self-contained without external files.

Yes! CSS mask properties including mask-size, mask-position, and gradient-based masks can be animated using CSS transition or @keyframes. This tool generates ready-to-use animation keyframes for zoom reveals, directional wipes, and pulsing effects. For best performance, animate mask-size and mask-position rather than recreating the mask on each frame, as these trigger compositor-only repaints (no layout recalculations).

Feathering (soft edge) controls how gradually the mask transitions from fully visible to fully hidden. A feather of 0 creates a hard, sharp edge. Higher feather values create a smooth gradient fade at the mask boundary, which is essential for natural-looking vignettes, spotlight effects, and professional image reveals. For gradient-based masks (circle, ellipse), feathering is achieved by expanding the gradient transition zone. For SVG shapes, a feGaussianBlur filter is applied.

CSS masks are generally GPU-accelerated and performant. Using radial-gradient or linear-gradient as masks is extremely efficient. SVG-based masks with complex paths or heavy blur filters may have a slightly higher rendering cost but are still well-optimized in modern browsers. For the best performance on image-heavy pages, avoid animating dozens of masked elements simultaneously and prefer gradient-based masks over complex SVG filters when possible.