How to Configure Strict CSS View-Transition-Old and New Filter Invert Mono Inversions in Google Chrome

Modern medical imaging diagnostics, x-ray preview platforms, and high-contrast digital microscopy tools often require monochromatic color inversion where grayscale luminance is reversed cleanly without introducing chromatic color fringing. With Google Chrome’s native View Transition API, applying animated filter: invert(1) grayscale(1) rules directly to ::view-transition-old and ::view-transition-new unlocks hardware-accelerated negative transitions without mutating underlying DOM nodes.

Chromium View Transition Monochromatic Inversion Mechanics

Chromium calculates color inversion in the GPU compositor by subtracting RGB values from unity while projecting chroma channels to zero. Chaining inversion with desaturation prevents false color casts and ensures pristine monochromatic luminance reproduction.

Authoring Strict Monochromatic Inversion Keyframes

Configure complementary negative exposure keyframes in your stylesheet:

::view-transition-old(mono-xray) {
  animation: 350ms cubic-bezier(0.4, 0.0, 0.2, 1.0) both xrayOut;
}

::view-transition-new(mono-xray) {
  animation: 350ms cubic-bezier(0.4, 0.0, 0.2, 1.0) both xrayIn;
}

@keyframes xrayOut {
  from {
    filter: invert(0) grayscale(1);
    opacity: 1;
  }
  to {
    filter: invert(1) grayscale(1);
    opacity: 0.2;
  }
}

@keyframes xrayIn {
  from {
    filter: invert(1) grayscale(1);
    opacity: 0.2;
  }
  to {
    filter: invert(0) grayscale(1);
    opacity: 1;
  }
}

Preserving Dynamic Contrast

Because full inversion can compress shadow details, combine filter: invert(1) grayscale(1) contrast(1.15) to preserve delicate low-light features and edge definitions.

Auditing in Chrome DevTools

Open Chrome DevTools > Rendering drawer and check Frame Rendering Stats. Confirm that Chromium executes monochromatic inversion entirely on the GPU compositor thread without triggering layout reflows or software rasterization passes.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.