Optimize for speed when rendering screenshots in Puppeteer and Chrome DevTools Protocol

Let's talk about the optimizeForSpeed parameter introduced in Chrome DevTools Protocol which will soon be supported by Puppeteer or even supported now at the time when you are reading the post.

1 min read

Written by

Dmytro Krasun

Published on

The optimizeForSpeed option is introduced in an update for Chromium, allows to use of faster encoding for images, and might increase the performance of taking screenshots by a lot.

Internally, the browser will use faster encoding for PNG, JPEG and WebP formats by restricting compression to zlib q1, which is rle encoding.

Try the option yourself to see if it improves performance and doesn’t change the quality of your screenshots.

By the way, there is a few related articles you might be interested in:

  1. Capture beyond viewport in Puppeteer and Chrome DevTools Protocol.
  2. Take a screenshot “from the surface” in Puppeteer and Chrome DevTools Protocol.
  3. A complete guide on how to take full page screenshots with Puppeteer, Playwright or Selenium.

Read more posts

Interviews, tips, guides, industry best practices, and news.

View all posts

Automate website screenshots

Exhaustive documentation, ready SDKs, no-code tools, and other automation to help you render website screenshots and outsource all the boring work related to that to us.