You can give an image a shape in CSS three ways: border-radius for rounded shapes like arches, pills and circles; clip-path: polygon() for straight-edged shapes like diagonals and hexagons; and mask with an SVG for anything curvy, such as blobs, waves and squircles. In every case the image stays a normal <img> with its alt text, and aspect-ratio with object-fit: cover keeps a row of mixed photos the same shape.
Key takeaways
- Use the simplest method that gives the shape:
border-radius, thenclip-path, thenmask. - Set
aspect-ratioandobject-fit: coverso every image fills the shape without stretching. box-shadowfollows the original rectangle. Usefilter: drop-shadow()on a parent for a shadow that follows the shape.- The image stays accessible and indexable because only its visible outline changes.
Which CSS method should you use for each shape?
| Shape | Method | Notes |
|---|---|---|
| Circle, pill, rounded | border-radius | Fastest and simplest; works everywhere |
| Arch | border-radius on the top corners | A huge radius on the top corners becomes a semicircle |
| Diagonal cut, hexagon, triangle | clip-path: polygon() | Percentage points scale with the image |
| Blob, wave edge, leaf | mask with an SVG | Any shape at all; the SVG stretches to the image |
| Squircle | mask or corner-shape | See our guide to CSS squircles |
How do you make an arch-shaped image?
.arch {
aspect-ratio: 3 / 4;
width: 100%;
object-fit: cover;
border-radius: 9999px 9999px 0 0;
}
Browsers scale down radii that are too large to fit, so a very large value on the two top corners becomes exactly half the width: a perfect semicircle. Change the aspect ratio for a taller or squatter arch. This is the shape behind many current portfolio and wellness-brand layouts.
How do you cut an image with clip-path?
/* Diagonal bottom edge */
.diagonal { clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); }
/* Hexagon */
.hexagon {
aspect-ratio: 1;
object-fit: cover;
clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
Each pair is an x and y position, as a percentage of the element. Because the points are percentages, the shape scales with the image. A diagonal edge on a hero image is a quick way to break up a page of rectangles.
How do you make a blob or wavy image?
Curved, organic outlines need a mask. You draw the shape as an SVG, and the browser shows only the parts of the image inside it:
.blob {
aspect-ratio: 1;
object-fit: cover;
-webkit-mask: url("blob.svg") center / 100% 100% no-repeat;
mask: url("blob.svg") center / 100% 100% no-repeat;
}
The SVG can be a separate file or an inline data URI; the SVG to CSS converter turns an SVG into a URL-encoded string you can paste into the url(). With 100% 100% sizing, the mask stretches to fit, so keep the aspect ratio close to the SVG’s own proportions.
Keeping a gallery of shaped images consistent
Organic shapes look best when every image in a set has the same proportions. Photos arrive in all sizes, so set the shape’s proportions on the image and let it crop:
aspect-ratio: 4 / 5(or whatever ratio you choose) fixes the shape.object-fit: coverfills it without stretching.object-positionmoves the crop, for examplecenter 30%to keep faces in frame.
Shadows: A box-shadow on a clipped or masked image is cut off along with everything else outside the shape. Wrap the image and put filter: drop-shadow(0 12px 24px rgb(0 0 0 / .25)) on the wrapper. Drop shadows follow the visible pixels, so they trace the arch or blob.
Can you animate an image shape on hover?
Yes. Browsers can transition between two border-radius values, and between two clip-path: polygon() values as long as both polygons have the same number of points. A diagonal edge that straightens on hover, or an arch that softens into a rounded rectangle, makes a subtle interactive card:
.diagonal {
clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
transition: clip-path .4s ease;
}
.diagonal:hover {
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
@media (prefers-reduced-motion: reduce) {
.diagonal { transition: none; }
}
SVG masks can’t morph smoothly between two different files, so keep blob and wave shapes static, or animate the image inside them instead, for example with a slight scale on hover.
Are shaped images bad for SEO or accessibility?
No. CSS only changes what is painted on screen. The <img> element, its src, its alt text and its dimensions are untouched, so screen readers announce it normally and search engines index it as an image. That is a big advantage over exporting pre-shaped PNGs, which also need re-exporting every time the photo changes. Keep serving the image at sensible sizes with srcset and sizes.
Using image shapes in Elementor, Divi and WordPress
The image shape generator has a “Paste into” menu that targets the image inside Elementor’s Image widget, Divi’s Image module, Bricks, Breakdance or a WordPress Image block, with steps for where to paste the CSS. Try it on your own photo first; the image stays on your device.
Shape your images
Pick an arch, circle, pill, squircle, blob, wave edge, diagonal, hexagon or leaf in the image shape mask generator, set the proportions and copy the CSS. For a decorative blob behind an image rather than a mask on it, try the CSS blob generator.
Last checked: October 2026.
Sources: MDN: clip-path, MDN: mask, MDN: object-fit.


