1

I'm using puppeteer via browsershot to take a screenshot of an D3 SVG graph. While the graph looks perfectly fine when previewed on the local URL, once I screenshot it with puppeteer it doesn't look as sharp as before.

Manually taken screenshot (sharp):

enter image description here

Puppeteer screenshot (blurry):

enter image description here

I'm running the following code with Browsershot. It's a wrapper around puppeteer.

// take a screenshot and save it as a file for now
Browsershot::url('http://dev.project.com/' . $insight->slug . '/chart')
    ->windowSize(1200, 600)
    ->waitUntilNetworkIdle()
    ->setDelay(10000)
    ->save($temp_file_path);

I've tried tweak the viewport and screenshot sizes - always the same. Maybe someone has an idea what I can try out/look at?

Cheers!

spekulatius
  • 1,434
  • 14
  • 24

1 Answers1

1

Browsershot has an option image quality.

Browsershot::url('https://example.com')
    ->setScreenshotType('jpeg', 100)
    ->save($pathToImage);
Chuong Tran
  • 3,131
  • 17
  • 25