SVG✨ Premium

Blob Mask

A block cut into an organic pebble shape by an SVG mask, gently tightening and easing back: gradient, photo or figure inside.

CSSSVG MaskOrganic

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. SVG has 30 effects, including 3 free. Explore the category →

3 usage examples

Pebble-shaped portrait on a naturopath's “About” page — Blob Mask example 1

① Pebble-shaped portrait on a naturopath's “About” page

WhenA naturopath's introduction page: on the left her portrait in a 206 px pebble that breathes slowly, on the right “Hello, I'm Aude”, a paragraph about her practice, two lines of training and the “Book an appointment” button.
WhyA soft, irregular shape suits a wellbeing practice better than a circle or a square. The slow, barely noticeable breathing brings the photo to life without pulling attention from the text.
Settings--blm-size:206px, --blm-speed:6s, --blm-min:92% (subtler breathing), --blm-page:transparent, --blm-height:0px; an <img alt=""> replaces the label (portrait drawn in SVG here, a photo in production).
Organic badge behind a holiday cottage's “4.8” rating — Blob Mask example 2

② Organic badge behind a holiday cottage's “4.8” rating

WhenA cottage's review block: the “4.8” rating in white inside a small 78 px green pebble, next to “Guests love it · 126 reviews”, the per-criterion breakdown (cleanliness, location, welcome) and two review excerpts.
WhyThe rating is what people look for first; the breathing badge flags it with no stars or loud badge, and its natural shape fits a countryside stay.
Settings--blm-size:78px, --blm-fill:linear-gradient(135deg,#84cc16,#15803d), --blm-speed:3.2s; “4.8” label at 22 px, weight 800, in the scene CSS.
Large shape behind an artisan soap maker's hero — Blob Mask example 3

③ Large shape behind an artisan soap maker's hero

WhenA soap maker's home page: on the left “Cured six weeks, cut by hand”, the copy and the “Visit the shop” button; on the right a large 330 px pastel pebble bleeding off the page edge, with the soap photo resting on it and its price tag.
WhyThe shape acts as a plinth for the product and gives depth to a plain background, without a lifestyle photo. It bleeds off on purpose: the hero feels wider than the screen.
Settings--blm-size:330px, --blm-fill:linear-gradient(150deg,#f5d0e6,#d8c4f0 55%,#c4dcf0), --blm-speed:7s, --blm-min:90%; label removed, root set to position:absolute (right:-46px) by the scene CSS, soap image on top.

How it works

The .blm-blob block is a square (220 px by default, aspect-ratio:1) filled with a cyan → blue → indigo gradient. Its mask-image is a blob shape drawn in SVG and written straight into the CSS (data URI): only the areas covered by the shape stay visible. The mask is centred, not repeated, and spans the square's full width: the whole outline shows, rounded edges and dips included.

The blmBreathe animation takes the mask size from 100% to 86% and back over 4 s (ease-in-out, looping). The shape tightens towards its centre and returns, like breathing; the content itself does not move. Range and duration are set with --blm-min, --blm-max and --blm-speed.

Everything inside the block is cut with it: the centred word “BLOB”, or an <img> filling the square (object-fit:cover). CSS only, no JavaScript; every mask declaration is paired with its -webkit- version.

Accessibility

  • Reduced motion: under prefers-reduced-motion: reduce the animation is removed; the blob stays full size and still.
  • Slow motion: one cycle lasts 4 s and the shape only varies by 14%: no flashing, no jumps.
  • Content: the text is a real <span> and an image keeps its alt. The blob's edges trim part of the image: keep the subject centred.
  • Pointer: the blob is decorative and does not respond to clicks and keeps the normal cursor.

Browser compatibility

SVG data-URI mask-image, animated mask-size (with -webkit- versions for Chrome and Edge before 120 and Safari before 15.4), CSS variables inside @keyframes, aspect-ratio, inset. Measured in Chromium, Firefox and WebKit (Playwright): shape visible (removing the mask changes 8 to 10% of the image), breathing, two copies, reduced-motion stop, 390 px.

Chrome 88+✓ Full (measured)
Firefox 89+✓ Full (measured)
Safari 15+✓ Full (measured in WebKit)
Edge 88+✓ Full (Chromium engine)
Safari iOS 15+✓ WebKit engine, not verified on a real device
Chrome Android 88+✓ Full (Chromium engine)

Without masking the whole square shows, uncut. Without aspect-ratio, give the block a height equal to --blm-size.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0627-root">
  <div class="blm-blob">
    <span class="blm-label">BLOB</span>
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Size (CSS — --blm-size) 220px Side of the square; the shape follows. 100% to fill a parent.
Fill (CSS — --blm-fill) linear-gradient(135deg, #06b6d4, #3b82f6, #6366f1) Any background value. An <img> placed in the block covers it.
Breathing (CSS — --blm-min, --blm-max) 86% / 100% Extreme mask sizes. Keep --blm-max at 100% or less: beyond that the shape leaves the square and gets trimmed.
Cycle duration (CSS — --blm-speed) 4s 6 to 8 s for a calm background, 3 s for a livelier badge.
Block background and height (CSS — --blm-page, --blm-height) #0a0a0f / 300px transparent and 0px to drop the blob into your layout.
Shape (CSS — the path's d attribute in the mask URL) 10-curve pebble Swap in another blob path (blob generator, Figma, Inkscape) in a 200 × 200 viewBox; change it in both mask-image and -webkit-mask-image.

FAQ

The blob is drawn in a 200 × 200 square and the mask spans the block's full width (mask-size of 100% at most). On a square block, the whole outline shows throughout the breathing. On a block wider than it is tall, the mask would keep its proportions and the shape would be cut at the top and bottom: keep aspect-ratio:1 and only change --blm-size.
Replace the <span class="blm-label"> with <img src="portrait.jpg" alt="…">: the image covers the square, then the mask cuts it. A tightly framed portrait with the face centred works best.
This code varies the mask's size, not its outline: a mask-image cannot morph from one shape to another. For a shape that deforms, animate an SVG path (see the Morphing Shape effect in the same category) or an eight-value border-radius.