Chrome HDR artefacting fix

Chrome's GPU rasterizer tiles large composited layers, and a lingering
will-change: transform keeps an image promoted to one of those layers
indefinitely — on HDR gain-map photos scaled down to fit the page,
that can leave visible seam lines at the tile boundaries. Drop the
hint once the fade transition actually ends so the image reverts to
normal (non-promoted) painting afterwards.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Djeex
2026-08-16 14:12:07 +02:00
co-authored by Claude Sonnet 5
parent 40a01c4701
commit 2185aba135
+8
View File
@@ -32,6 +32,14 @@ window.addEventListener("DOMContentLoaded", () => {
img.classList.add("loaded");
};
// Chrome HDR artefacting fix
const clearWillChange = (e) => {
if (e.propertyName !== "transform") return;
img.style.willChange = "auto";
img.removeEventListener("transitionend", clearWillChange);
};
img.addEventListener("transitionend", clearWillChange);
if (img.complete && img.naturalHeight !== 0) {
onLoad(); // already loaded
} else {