# Duotone Image

> Maps any photo to two brand colors with blend modes, then shows the original image on hover.

- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: duotone, mix-blend-mode, image filter, brand colors, photo effect, hover
- Live preview: https://copy-css.com/snippets/duotone-image
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="duotone">
  <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Crect width='60' height='40' fill='%23bae6fd'/%3E%3Ccircle cx='14' cy='11' r='6' fill='%23fde047'/%3E%3Cpath d='M0 40V30l15-6 15 5 15-7 15 6v12z' fill='%2334d399'/%3E%3Cpath d='M36 31l5-15 5 15zM45 32l4-11 4 11zM8 36l4-12 4 12z' fill='%23047857'/%3E%3C/svg%3E" alt="Green hills and pine trees on a sunny day" width="240" height="160">
</div>
```

## CSS

```css
.duotone {
  --light: #fde68a;
  --dark: #9d174d;
  position: relative;
  width: 240px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--light);
  isolation: isolate;
}

.duotone img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.1);
  mix-blend-mode: multiply;
}

.duotone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--dark);
  mix-blend-mode: lighten;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.duotone:hover img {
  filter: none;
  mix-blend-mode: normal;
}

.duotone:hover::after {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .duotone::after {
    transition: none;
  }
}
```

## Notes

- This CSS Duotone Image is 43 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, filters, blend modes and custom properties.
- Customize with: `--light`, `--dark`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
