Contrast Increase

The image transitions to higher contrast on hover/focus.

Contrast Increase demo

Hover or focus the image to see the effect.

HTML

description

CSS

.hover-effect.contrast-increase img{
  filter: contrast(1);
  transition: filter 0.5s ease;
}
.hover-effect.contrast-increase:hover img,
.hover-effect.contrast-increase:focus-visible img{
  filter: contrast(1.6);
}
@media (prefers-reduced-motion: reduce) {
  .hover-effect.contrast-increase img{
    transition: none;
  }
  .hover-effect.contrast-increase:hover img,
  .hover-effect.contrast-increase:focus-visible img{
    filter: contrast(1.6);
  }
}

The animates filter: contrast() from 1 to 1.6. Select the code and copy with Ctrl+C or ⌘C.