<img src="https://picsum.photos/id/195/300/300" alt="walking in a city" >
<img src="https://picsum.photos/id/216/300/300" alt="walking in a forest">
img {
  --s: 20px;  /* control the size of the wave */
  --w: 300px; /* preferred image width */
  
  width: round(var(--w),4*var(--s)); 
  aspect-ratio: 1;
  box-sizing: border-box;
  --_g: conic-gradient(#000 0 0) no-repeat 50%/;
  mask: 
    radial-gradient(calc(sqrt(2)*var(--s)),#000 calc(100% - 1px),#0000)
     0 0/calc(var(--s)*4) calc(var(--s)*4),
    var(--_g) calc(100% - 4*var(--s)) calc(100% - 4*var(--s)),
    var(--_g) calc(100% - 2*var(--s)) calc(100% - 2*var(--s)) subtract,
    radial-gradient(calc(sqrt(2)*var(--s)),#000 100%,#0000 calc(100% + 1px)) 
     calc(2*var(--s)) calc(2*var(--s))/calc(var(--s)*4) calc(var(--s)*4);
}


body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-auto-flow: column;
  place-content: center;
  gap: 40px;
  background: #F2E9E1;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.