Puppeteer: screenshots in headless Chromium result in blocky gradients

Viewed 318

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?

0 Answers
Related