Modern editorial and photography interfaces often use desaturation and monochrome effects to create artistic, focused transitions. When navigating from a vibrant multi-coloured photo gallery into a minimalist article view, or when placing an inactive background into an archival or disabled state, applying a gradual greyscale transition provides clear visual feedback. With the View Transition API in Chromium, developers can apply filter: grayscale(...) directly to ::view-transition-old and ::view-transition-new pseudo-elements, orchestrating monochromatic desaturation without modifying original DOM images.
Configuring strict grayscale filters in Google Chrome ensures smooth chromatic transitions between colourful state captures and monochromatic representations.
Chromium View Transition Grayscale Mechanics
During an active transition, Chromium hosts the old and new raster snapshots within the pseudo-element image pair:
::view-transition
└─ ::view-transition-group(gallery-focus)
└─ ::view-transition-image-pair(gallery-focus)
├─ ::view-transition-old(gallery-focus)
└─ ::view-transition-new(gallery-focus)
By declaring custom keyframe animations that interpolate filter: grayscale(), authors can achieve smooth desaturation transitions:
/* Editorial Desaturation Transition */
::view-transition-old(gallery-focus) {
animation: 400ms cubic-bezier(0.4, 0, 0.2, 1) both photo-desaturate-out;
}
::view-transition-new(gallery-focus) {
animation: 400ms cubic-bezier(0.16, 1, 0.3, 1) both photo-monochrome-in;
}
@keyframes photo-desaturate-out {
0% {
filter: grayscale(0%) contrast(100%);
opacity: 1;
}
100% {
filter: grayscale(100%) contrast(110%);
opacity: 0;
}
}
@keyframes photo-monochrome-in {
0% {
filter: grayscale(100%) contrast(110%);
opacity: 0;
}
100% {
filter: grayscale(100%) contrast(100%);
opacity: 1;
}
}
Selective Color Pop on Hover or Expansion
Conversely, when an interactive black-and-white preview card expands into full colour upon navigation, reverse the filter progression:
::view-transition-old(color-reveal) {
animation: 250ms ease-out both fade-out;
filter: grayscale(100%);
}
::view-transition-new(color-reveal) {
animation: 450ms cubic-bezier(0.16, 1, 0.3, 1) both color-burst;
}
@keyframes color-burst {
0% {
filter: grayscale(100%) brightness(0.9);
opacity: 0;
}
100% {
filter: grayscale(0%) brightness(1);
opacity: 1;
}
}
Inspecting Grayscale Transitions in Chrome DevTools
To audit filter rendering during transitions in Google Chrome:
- Open DevTools (F12) and bring up the Animations drawer via
Ctrl+Shift+P>Show Animations. - Trigger the state change. Chrome DevTools captures the transition animation tracks.
- Scrub the timeline to 50% completion to inspect intermediate saturation values.
- Select
::view-transition-old(gallery-focus)in the Elements panel. - In the Computed panel, confirm that
filtercomputes to intermediate values (e.g.grayscale(0.5)) without triggering unwanted GPU layer invalidations.
Configuring strict grayscale filters produces polished, publication-grade monochromatic visual transitions across Google Chrome.