4

I have a web page with a linear gradient

background: linear-gradient(180deg, #7e7e7e 0%, #454545 100%);

When I take a PNG screenshot with PuppeteerSharp, it looks fine.

However, if I enable headless mode, the gradient looks really blocky, as if color precision is lost when applying gamma correction, or like jpeg compression color quantization...

I tried passing the --force-color-profile argument, and that results in different colors, but the blocks remain.

Does anyone know how to improve the quality of Puppeteer screenshots with gradients?

Ziriax
  • 1,012
  • 10
  • 19
  • I debugged this a bit, and it seems the non-headless version applies dithering to the gradient, and the headless version doesn't. – Ziriax Aug 31 '20 at 12:56

0 Answers0