Shapes & Visual FX

Punching media through bold editorial typography and vector shapes with mask-image

Cutting high-definition video or photography directly through the bold strokes of monumental typography is one of my favorite editorial techniques. In this lab, we use CSS mask-image and background-clip: text to create striking magazine-style headlines.

📖 Read the Complete Tutorial: CSS mask-image & Alpha Compositing Guide →
Image Mask & Alpha Gradient Studio

How to Use the Image Mask Studio (3 Simple Steps)

1

Choose Your Mask Type

Select from linear gradient fades, radial or conic gradients, vignette, spotlight, or SVG polygon shapes like diamonds, hexagons, stars, arrows, and hearts.

2

Tune Fade Points & Focal Position

Drag the fade-start and fade-end sliders to control where transparency begins and ends. For radial and spotlight masks, set the precise X/Y focal point percentage.

3

Copy mask-image CSS

Copy the production-ready mask-image (and optional -webkit-mask-image) declarations, or download the full self-contained HTML demo file.

Features & CSS Best Practices

✓

8 Mask Types in One Tool

Covers every major CSS masking technique: linear, radial, and conic alpha gradients; vignette; spotlight; and three SVG polygon cutout modes — all from one unified interface.

✓

SVG Polygon Masks via Data URI

Diamond, hexagon, star, arrow, and heart shapes are encoded as inline SVG data URIs in mask-image, requiring zero external image files and scaling perfectly at any resolution.

✓

WebKit Prefix Toggle

One click adds or removes the -webkit-mask-image prefix, ensuring compatibility with Safari 15 and older iOS WebKit browsers without cluttering modern-only stylesheets.

✓

Soft Alpha Edges — Not Hard Clips

Unlike CSS clip-path which produces hard geometric cuts, mask-image supports true alpha transparency, letting edges fade softly to transparent for natural-looking image reveals.

WordPress & Elementor Integration

How to Use CSS Image Masks & Gradient Fades in Elementor

Fade photos seamlessly into background colors, create feathered edges, or mask images into organic vector shapes in Elementor in 3 simple steps.

1

Copy Elementor / WP Code

In the code studio above, switch to the Elementor / WP tab and click Copy to get the self-contained bundle with mask-image CSS and image markup.

2

Insert an HTML Widget

In your WordPress dashboard, edit your page with Elementor (Free or Pro). Drag an HTML widget onto your canvas.

3

Paste & Update Image URL

Paste the snippet into the HTML Code box. Replace the sample image source with your photo from the WordPress Media Library.

🎨

Seamless Background Blending

Linear and radial mask-image fades melt harsh rectangular photograph edges into the page background color for seamless editorial layouts.

⚡

Safari Prefix Protection

Includes both standard mask-image and vendor-prefixed -webkit-mask-image for 100% reliable rendering on iOS and macOS Safari.

Frequently Asked Questions

How do I create gradient fade image masks in Elementor?

Switch to the Elementor / WP tab in the generator above and click Copy. In WordPress, open your Elementor canvas, drag an HTML widget into your section, and paste the code snippet. Replace the sample image URL with your WordPress Media Library image URL.

What is the difference between CSS mask-image and clip-path?

Both hide parts of an element, but in different ways. clip-path uses geometric shapes with hard, pixel-sharp edges — everything outside the shape is completely invisible. mask-image uses a grayscale or alpha channel image (including CSS gradients) to control opacity pixel-by-pixel, so edges can be soft, gradient, or partially transparent. Use clip-path for crisp geometric cuts; use mask-image when you need smooth fades, vignettes, or feathered edges.

Do I need the -webkit-mask-image prefix in 2024?

The unprefixed mask-image property is now supported in Chrome 120+, Firefox 53+, and Safari 15.4+. However, if you need to support older iOS Safari (pre-15.4) or older macOS Safari, the -webkit-mask-image prefix is still required. Enabling the prefix toggle in this tool adds both the prefixed and unprefixed declarations so your code works everywhere.

Can I apply a mask-image to an <img> HTML element?

Yes! You can apply mask-image directly to an <img> tag just like to a div. For example: img { mask-image: linear-gradient(to bottom, black 60%, transparent 100%); }. This fades the bottom of the photo to transparent, which is a popular technique for seamless image-to-background blends on landing pages.

How does a vignette mask differ from a CSS box-shadow vignette?

A box-shadow vignette uses inset shadows to simulate darkened edges but cannot create true transparency — it overlays a color. A mask-image vignette uses a radial gradient that maps to the element's alpha channel, making the edges genuinely transparent. This means content behind the element shows through, which is essential for image-on-gradient-background compositions where real edge transparency is required.

How do I create brush stroke or organic grunge image masks in CSS?

Use an SVG or PNG brush texture with mask-image: url("brush.png"); mask-size: 100% 100%;. The black pixels of the mask reveal the underlying photo, while transparent pixels create artistic torn-edge cutouts.

Can I use CSS radial-gradient to create a soft vignette mask on photos?

Yes. Set mask-image: radial-gradient(circle, black 50%, transparent 100%);. This softly dissolves photo edges into the surrounding background without modifying the original image.

How do I animate a geometric mask expansion on hover?

Animate mask-size from 0% to 100% or transition an SVG polygon mask on hover, creating high-fashion editorial photo reveal animations.