From 7bba36141cd791a7ad40d9bdd8aac161ddaa3a90 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Tue, 17 Mar 2026 17:29:02 +0100 Subject: [PATCH] fix(screenshot): normalize white detection to sRGB Convert images to sRGB before reading raw pixels so white screenshot detection uses consistent RGB values across inputs with different color profiles. --- packages/screenshot/src/is-white-screenshot.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/screenshot/src/is-white-screenshot.js b/packages/screenshot/src/is-white-screenshot.js index 9f6ee746b..d05688173 100644 --- a/packages/screenshot/src/is-white-screenshot.js +++ b/packages/screenshot/src/is-white-screenshot.js @@ -52,6 +52,7 @@ const isWhiteSampledImage = (data, { width, height, channels }) => { module.exports = async uint8array => { const input = Buffer.isBuffer(uint8array) ? uint8array : Buffer.from(uint8array) const { data, info } = await sharp(input) + .pipelineColourspace('srgb') .ensureAlpha() .raw() .toBuffer({ resolveWithObject: true })