question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Different color shades of screenshots taken from different displays

See original GitHub issue

I’m trying to use puppeteer for visual regression testing. When I do page.screenshot output images differ (in shades of colors) on different displays (MBP built-in display vs Dell monitor display). Am I missing some option?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
8eecf0d2commented, May 11, 2018

Have you tried the Chromium flag --force-color-profile=srgb|generic-rgb|color-spin-gamma24?

2reactions
cmcculloh-krcommented, Mar 7, 2018

I’m having the same issue. It looks like Chrome has changed the way they render colors.

Chrome is now following the “color rendering profile” of the device. This makes Puppeteer much less useful for visual regression testing if you are running the tests on two different machines (which I believe most people are). For instance, generating the initial screenshots on my local machine and then having my CI server (Heroku or TravisCI) run my tests on every PR is much less effective because the CI server has either no display, or a much poorer quality display than my Retina Macbook display, so I get a lot of false positives and my tests fail.

The way I’ve addressed this is by having different thresholds for my CI server than I have for local development, eg:

const threshold = isLocal ? 0 : 0.1;
const failureThreshold = isLocal ? 0 : 0.01;

export const commonSnapshotConfig = {
	customDiffConfig: { threshold },
	failureThreshold
};

This is sub-optimal to say the least. It would be great if there was a way to tell Puppeteer to pass a flag or something when it opens Chrome to force a color profile (either a default that lives in Puppeteer, or one that you provide).

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Different color shades of screenshots taken ... - GitHub
I'm trying to use puppeteer for visual regression testing. When I do page.screenshot output images differ (in shades of colors) on different ......
Read more >
Screenshot colors are wrong with color profiles (#3033) · Issues
Well the bug exists you thinking the colours are similar or not, right? The screenshot is supposed to be accurate to what is...
Read more >
The screenshot's color from "Make Screenshot" is different ...
I use 3 methods to take screenshots: 1) Menu -> Make Screenshot 2) Send ... the same colors, while 1) produces slightly different...
Read more >
Print screen does not save the right colors. How can I fix it?
I have two monitors, and I pulled the aseprite window to the another one, and on that screen the colors are wrong and...
Read more >
BUG (or feature?) — Figma imports screenshots with the ...
Figma imports screenshots with the "wrong" colors in sRGB colorspace ... import them both back into Figma, they will be different colors.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found