JSFiddle - React, Tailwind, and code Playground

by toubia95

HTML

<span class="duotone"><img src="https://blog.frantext.fr/wp-content/uploads/2022/03/dispersion-690x345.png"></span>

CSS

.duotone {
  background-color: #1e88e5;
  display: inline-block;
  overflow: hidden;
  position: relative;
  outline: 1px solid #000;
  outline-offset: -1px;
}

.duotone img {
  filter: grayscale(100%);
  height: 100%;
  max-width: 100%;
  mix-blend-mode: hard-light;
  object-fit: cover;
  opacity: 1;
  position: relative;
  width: 100%;
  }
  .duotone:hover img {
    filter: none;
    mix-blend-mode: normal;
  }

.duotone::before {
  content: '';
  background-color: #000000;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  mix-blend-mode: lighten;
  height: 100%;
  width: 100%;
  z-index: 1;
  }
  .duotone::before:hover {
  background-color: none;
  mix-blend-mode: normal;
}