htmlcsssvgmix-blend-modebackground-blend-mode

Creating photoshop layer blend effects in CSS


I need to provide this image with css. A layer must be placed on the image. I can't get exactly the same appearance. Is there a solution to this? It can also be an SVG filter.

Intended result: enter image description here

I've tried it, but I can't make it.

div {
  width: 400px;
  height: 800px;
  background-image: url("https://i.sstatic.net/z5W7Q.jpg");
  background-color: rgba(16, 24, 45, 0.8);
  background-size: contain;
  background-repeat: no-repeat;
  background-blend-mode: darken;
}
<div></div>


Solution

  • I had solved this problem much later. I'd better add it here. Related answer.

    div {
      width: 400px;
      height: 400px;
      background-image: url("https://i.sstatic.net/z5W7Q.jpg");
      background-color: rgba(16, 24, 45, 0.8);
      background-size: cover;
      background-repeat: no-repeat;
      background-blend-mode: darken;
      position: relative;
    }
    
    div::before,
    div::after {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
    }
    
    div::before {
      background-color: gray;
      mix-blend-mode: color;
    }
    
    div::after {
      mix-blend-mode: overlay;
      background-color: #98aeea;
    }
    <div></div>