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.
- Free, no sign-up
- Nothing uploaded
- PNG, CSS, Tailwind
Drop a picture here
PNG, JPG, WebP or GIF. It stays on this device.
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
- Drop a picture. A photo, a screenshot or a logo. It opens in your browser and is never uploaded. No picture? Pick an example.
- 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.
- See it on your page colour. Choose white, black or your own colour behind it, or see-through.
- 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.
- Take it. Download the faded PNG with real transparency, or copy the
mask-imageCSS, 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-imagefor Safari. Where the gradient is black the image shows; where it is transparent the image fades out. Useto bottominstead ofto rightfor the top and bottom edges. - How do I fade all four edges?
- Use two gradients, one
to rightand oneto bottom, in the samemask-image, and addmask-composite: intersect(and-webkit-mask-composite: source-infor 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-imageandmask-imagewith 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.