11 questions for the Chrome screenshot docs
Questions a developer asks about Page.captureScreenshot and Puppeteer's page.screenshot. Each is answered by the docs, quoted as they read on 12 November 2026, then checked by a run. Here is the exchange where they disagreed.
The protocol docs
“Compression quality from range [0..100] (jpeg only).”[1]
The lab, Chrome 153
A webp capture was 8,004 bytes at quality 0 and 436,500 bytes at 100. A png was 464,645 bytes at every setting. Read the whole answer.
How the docs scored
A verdict is a statement about the page I read and the run I made, nothing more. The docs are short on purpose, so “silent” is not a fault: it marks the places where you have to measure.
Showing 11 of 11 questions.
Question 1 of 11
What do I get back, and in what format?
What the docs say
What was run
Called the protocol method with no parameters, then with each format, then Puppeteer with a binary result, a base64 result and seven file paths. The format was read from the first bytes of each file, not from its name.
Puppeteer, file written for each path (type left out)
| Path | Bytes say |
|---|---|
| a.png | png |
| a.jpg | jpeg |
| a.jpeg | jpeg |
| a.webp | webp |
| a.gif | png |
| a (no extension) | png |
| b.png with type "jpeg" | jpeg |
What it showed
With no parameters the call returned one field, data, a string of 619,528 characters. Decoded, it was a PNG of 800 x 600 pixels and 464,645 bytes. Each of png, jpeg and webp gave a file of that type; the format gif was refused with "Invalid image format".
Puppeteer returned a Buffer by default (a kind of Uint8Array, as its signature says). With encoding "base64" it returned the same string the protocol returned, character for character.
A path with an unknown extension (a.gif) or none gave a PNG. An explicit type won over the extension.
So
Question 2 of 11
Does the call wait for the page or its images?
What the docs say
“Capture page screenshot.”[1]
What was run
A page with one 200 x 200 red picture that the server answered after 1,000 ms. Opened it with Puppeteer's goto set to stop at domcontentloaded, took a screenshot at once, waited 1.5 s and took another. Five times. Then once with the default goto, which waits for the load event.
Colour of the picture area, five runs
| Shot | Pixel at the picture | Time of the call |
|---|---|---|
| Straight after domcontentloaded | white (empty) in 5 of 5 | 60 to 75 ms |
| 1.5 s later | red (loaded) in 5 of 5 | - |
| After the default goto | red | goto took 1,110 ms |
What it showed
The call took what a screenshot takes and returned. It did not wait for the picture that was still on its way, in 5 of 5 runs.
The wait lives in the step before it: goto's load event waited for the picture, and the picture was there.
So
Question 3 of 11
Can it capture what is below the fold?
What the docs say
“Capture the screenshot beyond the viewport. Defaults to false.”[1]
What was run
A 3,000 px page made of flat colour bands (one colour per 1,000 px) in a 800 x 600 window. Four calls, and a pixel read at 100, 1,500 and 2,900 px down to see which band each held.
Image size and what was in it
| Call | Image | Band at 100 / 1,500 / 2,900 px |
|---|---|---|
| No parameters | 800 x 600 | viewport only |
| captureBeyondViewport true, no clip | 800 x 3,000 | band 1, 2, 3 (all right) |
| clip of the whole page, captureBeyondViewport true | 800 x 3,000 | band 1, 2, 3 (all right) |
| clip of the whole page, captureBeyondViewport false | 800 x 3,000 | band 1, then white, then white (the cut is at 600 px, the window height) |
What it showed
The default gave the window only: 800 x 600, as the docs say.
Setting the flag with no clip gave the whole 3,000 px page, which the docs do not spell out.
The surprise is the last row: a clip taller than the window with the flag off still produced an image 3,000 px tall. Only the first 600 px, the window, held the page; the rest was white. No error was raised.
So
Question 4 of 11
Does fullPage give me the whole page?
What the docs say
“When `true`, takes a screenshot of the full page.”[3]
What was run
The same 3,000 px banded page with fullPage true, with fullPage true and captureBeyondViewport false, and with a clip added.
Puppeteer calls on the banded page
| Call | Result |
|---|---|
| fullPage: true | 800 x 3,000, bands right at the top and the foot |
| fullPage: true, captureBeyondViewport: false | 800 x 3,000, window back to 800 x 600 afterwards |
| fullPage: true with clip | error: 'clip' and 'fullPage' are mutually exclusive |
What it showed
fullPage did give the whole page, 800 x 3,000, with the right colour at the top and at the foot.
With the flag off, Puppeteer made the window as tall as the page for the shot and put it back after. The page sees a resize meanwhile, so a layout that reacts to height can change.
The option page never says that clip and fullPage cannot be combined. The code throws when they are.
So
Question 5 of 11
Does a clip below the fold work by default?
What the docs say
“`false` if there is no `clip`. `true` otherwise.”[3]
What was run
A 100 x 100 clip at y = 2,000 on the banded page (the third band) in a 800 x 600 window: through Puppeteer with the option left out, through Puppeteer with it set to false, and through the protocol with it set to false.
Clip at y = 2,000
| Call | Result |
|---|---|
| Puppeteer, option left out | 100 x 100, third band (right) |
| Puppeteer, captureBeyondViewport: false | error: Cannot take screenshot with 0 height. |
| Protocol, flag false | 100 x 100, all white |
What it showed
The default flipped as documented: the clip below the fold came back with the right band.
Forcing the flag off made Puppeteer cut the clip to the window first, which left nothing, and it threw. The raw protocol call did not throw: it returned a white image of the size asked for.
So
Question 6 of 11
How tall can a full-page capture be?
What the docs say
Neither the protocol method nor the Puppeteer options mention a maximum size for a capture.
What was run
Full-page captures of banded pages, 400 px wide, from 8,000 to 65,536 px tall, each with the colour at the foot checked. Then a search for the edge with pages 100 px and 400 px wide, and three very wide short pages.
Full-page PNG, 400 px wide
| Page height | Foot colour right | File | Time |
|---|---|---|---|
| 8,000 px | yes | 26,235 bytes | 497 ms |
| 16,000 px | yes | 52,386 bytes | 531 ms |
| 16,384 px | yes | 53,651 bytes | 580 ms |
| 16,385 px | yes | 53,655 bytes | 510 ms |
| 20,000 px | yes | 65,461 bytes | 778 ms |
| 32,768 px | yes | 107,217 bytes | 1,065 ms |
| 40,000 px | yes | 130,856 bytes | 1,304 ms |
| 65,536 px | yes | 214,353 bytes | 3,125 ms |
What it showed
Every height up to 65,536 px came back whole. The file and the time grew with the height: 497 ms at 8,000 px, 3,125 ms at 65,536 px. Nothing changed at 16,384 px.
The edge was at 131,072 px. A page 131,071 px tall worked, one pixel more failed with "Page is too large", at 100 px wide and at 400 px wide alike. Pages up to 20,000 px wide, 300 px tall, worked.
Those are limits of this Chrome build on this server, found by probing. A service puts its own, much lower, limits on top.
So
Question 7 of 11
What size is the image when I clip and scale?
What the docs say
“Rectangle width in device independent pixels (dip).”[1]
“Page scale factor.”[1]
Puppeteer lists the clip scale with a default of 1 and no description.
What was run
A 200 x 100 clip in windows with a device scale factor of 1, 2 and 3, each with clip scale 0.5, 1 and 2, through the page’s own protocol session. The size of each PNG was read from its header.
Image size of a 200 x 100 clip
| Device scale factor | clip scale 0.5 | clip scale 1 | clip scale 2 |
|---|---|---|---|
| 1 | 100 x 50 | 200 x 100 | 400 x 200 |
| 2 | 200 x 100 | 400 x 200 | 800 x 400 |
| 3 | 300 x 150 | 600 x 300 | 1,200 x 600 |
What it showed
Every cell is 200 x 100 times the clip scale times the device scale factor. The docs give the units of the clip (dip) and name the scale, but never say that the file is bigger on a dense screen.
A first try gave 200 x 100 where 400 x 200 was right: it had called the method through a second protocol session, which does not carry the first session’s window emulation. The numbers above use the page’s own session.
So
Question 8 of 11
Which formats does quality apply to?
What the docs say
What was run
The same noisy test picture as png, jpeg and webp at quality 0, 25, 50, 75 and 100 through the protocol, plus values outside the range, plus the same through Puppeteer.
File size in bytes by quality, protocol call
| Format | q 0 | q 25 | q 50 | q 75 | q 100 | quality left out |
|---|---|---|---|---|---|---|
| png | 464,645 | 464,645 | 464,645 | 464,645 | 464,645 | 464,645 |
| jpeg | 5,291 | 24,769 | 39,962 | 61,203 | 337,459 | 70,911 |
| webp | 8,004 | 22,380 | 32,054 | 42,586 | 436,500 | 50,814 |
What it showed
The protocol says jpeg only, and webp answers too: 8,004 bytes at 0 and 436,500 at 100. Puppeteer's wording, "not applicable to png", is the accurate one. The PNG did not change by a byte.
Values outside 0 to 100 (-1, 101, 1000) were not refused by the protocol: they gave the same file as leaving quality out. Puppeteer throws instead, for any quality above 100 or below 0, and for any quality on a png.
So
Question 9 of 11
Does optimizeForSpeed make it faster, and what does it cost?
What the docs say
“Optimize image encoding for speed, not for resulting size (defaults to false)”[1]
Puppeteer lists the option with a default of false and no description.
What was run
15 pairs of calls on the same noisy picture for each format, one with the flag off and one with it on, in turn. Median time of the call, and the size of the file.
Median of 15 runs
| Format | Time, flag off | Time, flag on | Bytes, flag off | Bytes, flag on |
|---|---|---|---|---|
| png | 199 ms | 107 ms | 464,645 | 586,708 |
| jpeg | 61 ms | 60 ms | 70,911 | 70,911 |
| webp | 133 ms | 135 ms | 50,814 | 50,814 |
What it showed
For PNG the call took 107 ms instead of 199 ms, and the file was 26% larger (586,708 bytes instead of 464,645).
For jpeg and webp the flag changed neither the time nor the size. The docs do not say it is a png matter.
So
Question 10 of 11
How do I get a transparent PNG?
What the docs say
“Hides default white background and allows capturing screenshots with transparency.”[3]
“Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one.”[2]
What was run
A page with a red 100 x 100 box and nothing else, a 300 x 200 window. The colour of an empty corner, read with Puppeteer’s option and with the protocol alone, with and without the override.
Colour of an empty corner (red, green, blue, alpha)
| Call | Corner |
|---|---|
| Puppeteer, default | white (255, 255, 255), opaque |
| Puppeteer, omitBackground: true | transparent (alpha 0) |
| Puppeteer, default, right after | white again |
| Puppeteer, omitBackground with type jpeg | white |
| Protocol, nothing set | white |
| Protocol, after the override with alpha 0 | transparent |
| Protocol, after clearing the override | white |
What it showed
The protocol's screenshot method has 6 parameters, and none is about the background. The option is Puppeteer's: it sets the override, takes the shot and clears it, so the next shot is white again.
The red box kept its colour (230, 25, 75, 255) in the transparent shot. JPEG has no alpha, so there the option changed nothing.
So
Question 11 of 11
What does fromSurface change?
What the docs say
“Capture the screenshot from the surface, rather than the view. Defaults to true.”[1]
What was run
The same page with the parameter left out, set to true and set to false, through the protocol and through Puppeteer. The base64 strings were compared character by character.
Result by value
| Value | Image | Same as the default? |
|---|---|---|
| left out | 800 x 600, 464,645 bytes | - |
| true | same | identical string |
| false | same | identical string |
| false, through Puppeteer | same size | yes |
What it showed
In headless Chrome on this server the three calls returned the same image, byte for byte.
The docs say where the pixels come from, not when it matters. One run in one browser does not show a difference, and it does not prove there is none elsewhere, for instance in a window with a screen.
So
Two things that went wrong in the lab
The first run crashed in the quality test. Puppeteer throws when you pass a quality with a png, so the loop that tried 10 and 90 on every format stopped at the first one. The catch is now in the script, and the error text is in question 8.
A clip came back at the wrong size. I sent the clip through a second protocol session, and it came back half the size on a window with a device scale factor of 2. Window emulation belongs to the session that set it, so a new session sees a window with a factor of 1. The same call through the page's own session gave the numbers in question 7. If you mix Puppeteer with raw calls, use its own session.
How it was run
On 12 November 2026. Puppeteer 25.17.0 (puppeteer-core) drove Chrome 153.0.8010.12 in headless mode on a Linux server. Test pages came from a local server and were small and made for one question each. Raw protocol calls went through a CDP session of the same page; image sizes were read from the file headers, and colours from single pixels decoded with sharp. Nothing was sent to a service.
The protocol text comes from the JSON file the protocol viewer is built from, because the viewer is a script-driven page with no text in its HTML.[1] The Puppeteer text comes from its API reference.[4][5] Quotes are copied as they were. Where a section says “docs silent”, the entries in the sources were read again for the missing point and it was not there.
The pages are small and made for one question each, so the numbers show what Chrome did with that page, not with yours. Chrome changes: a later version may give other sizes and other limits, which is a reason to run the cases again on yours.
The same choices as request options
CurlShot runs the browser for you, so the choices above become options on one request instead of protocol calls: format, image_quality (1 to 100, default 80, for jpeg and webp), omit_background (refused for jpeg), device_scale_factor, full_page with full_page_max_height (20,000 px by default, 30,000 at most), the four clip_* options, and wait_until (default load), delay and wait_for_selector for the waiting that the protocol leaves to you.
The tables above describe Chrome driven by Puppeteer, not the API: no request was sent to CurlShot in this run. To see the side-by-side code for your own script, read Puppeteer and Playwright screenshots as an API. To try a capture without an account, use the screenshot API page. The pricing page lists the free plan.
Related reading
Questions people ask
Does Page.captureScreenshot wait for the page to finish loading?
No. Its description is one line, "Capture page screenshot." In a run on 12 November 2026, a screenshot taken straight after domcontentloaded missed a picture that was still loading in 5 of 5 runs, and one taken after the load event had it. Wait for what you need before you call it. CurlShot has wait_until, delay and wait_for_selector for that.
Does the quality parameter work for webp?
Yes in Chrome 153.0.8010.12, though the protocol docs say "jpeg only". A webp capture was 8,004 bytes at quality 0 and 436,500 bytes at 100. A png did not change. Puppeteer's docs say "not applicable to png", and it throws for a quality on a png.
How do I take a transparent screenshot with Puppeteer?
Set omitBackground to true and use png or webp, on a page that does not paint its own background. The protocol method has no such parameter: Puppeteer sets Emulation.setDefaultBackgroundColorOverride with alpha 0, takes the shot and clears the override. A jpeg has no alpha and stays white.
How tall can a full-page screenshot be?
The docs give no limit. In Chrome 153.0.8010.12 headless, a page 131,071 px tall was captured whole and one of 131,072 px failed with "Page is too large", at 100 px wide and at 400 px wide. A hosted service sets its own, lower, limit: CurlShot stops at 20,000 px by default and 30,000 px at most.
What size is the image when I use clip with scale?
The clip width times the clip scale times the device scale factor, and the same for the height. A 200 x 100 clip at a device scale factor of 2 and a clip scale of 1 gave 400 x 200 pixels. The docs give the unit of the clip as device independent pixels but do not state this.
Sources
- [1]Chrome DevTools Protocol, Page.captureScreenshot (Chrome DevTools Protocol, tip-of-tree). Checked .
- [2]Chrome DevTools Protocol, Emulation.setDefaultBackgroundColorOverride (Chrome DevTools Protocol, tip-of-tree). Checked .
- [3]Puppeteer, ScreenshotOptions interface. Checked .
- [4]Puppeteer, Page.screenshot() method. Checked .
- [5]Puppeteer, ScreenshotClip interface. Checked .
Read next
- CalculatorScreenshot API vs headless browser: the real costA cost calculator with every assumption editable, the hidden work behind headless Chrome, and an honest checklist for build or buy.
- Rosetta stoneWebsite screenshot code examples in 8 languagesThe shortest working code to save a full-page screenshot of a website in curl, Node.js, Python, PHP, Go, Ruby, Java and C#, side by side.
- Field guideWhy website screenshots look wrong, and the fixesA field guide to 11 ways a website screenshot goes wrong, from blank lazy images to cookie banners and cut-off pages, with the cause and the fix for each.