Fade Edges Generator
← SkillSafe

Fade the edges of an image to transparent

Drop a picture, pick the sides to fade, then download the faded PNG or copy the CSS mask.

Drop a picture here
PNG, JPG, WebP or GIF. It stays on this device.

Already have mask CSS? and it opens here.

No picture handy? Try one:

How it works

  1. Drop a picture. A photo, a screenshot or a logo. It opens in your browser and is never uploaded. No picture? Pick an example.
  2. Pick the sides. Left and right, top and bottom, one side or all four, and how far the fade reaches. It is drawn with the real CSS mask, so the preview is what your page will show.
  3. See it on your page colour. Choose white, black or your own colour behind it, or see-through.
  4. Check it. The page measures the edges of your picture and warns when a fade covers busy detail, when a dark edge on a light page will show as a band, and when two fades leave little at full strength.
  5. Take it. Download the faded PNG with real transparency, or copy the mask-image CSS, an inline style or Tailwind classes.

Questions

How do I fade the edges of an image with CSS?
Put a linear-gradient mask on the image: mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent), and the same value in -webkit-mask-image for Safari. Where the gradient is black the image shows; where it is transparent the image fades out. Use to bottom instead of to right for the top and bottom edges.
How do I fade all four edges?
Use two gradients, one to right and one to bottom, in the same mask-image, and add mask-composite: intersect (and -webkit-mask-composite: source-in for Safari). Without it the two layers add together and each fills in the other's fade, so only the corners change.
Why does my mask do nothing in Safari?
Safari before 15.4 and some in-app browsers only read -webkit-mask-image. Write both -webkit-mask-image and mask-image with the same value. The code here does.
Percent or px?
Percent scales with the picture, so a 15% fade looks the same on a phone and on a wide screen. Use px when the fade must stay the same size on every width, like the ends of a scrolling row.
Can I fade text or a whole section, not just an image?
Yes. The mask works on any element with visible content: put the class on the text block or section. A mask only hides; it cannot fade an element whose background is empty.
Is my picture uploaded?
No. The picture is opened, measured and faded in your browser, and the PNG is made on your device. The optional AI step sends only the fade settings, the page's measurements and your description, never the picture, and only when you press its button.