Skip to content
Q&A with the docsBy 9 min read

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.

Which formats does quality apply to?

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.

Q&A with the docsDocs read and run on 12 November 2026Chrome 153Puppeteer 25.17.0

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.

Show the questions where the docs…

Showing 11 of 11 questions.

Question 1 of 11

What do I get back, and in what format?

Docs hold

What the docs say

“Base64-encoded image data. (Encoded as a base64 string when passed over JSON)”[1]
Protocol, result data
“Image compression format (defaults to png).”[1]
Protocol, parameter format
“The screenshot type will be inferred from file extension.”[3]
Puppeteer, parameter path

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)

PathBytes say
a.pngpng
a.jpgjpeg
a.jpegjpeg
a.webpwebp
a.gifpng
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

Trust the extension rule only for png, jpg, jpeg and webp. For anything else, set type yourself.

Question 2 of 11

Does the call wait for the page or its images?

Docs silent

What the docs say

“Capture page screenshot.”[1]
Protocol, method description

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

ShotPixel at the pictureTime of the call
Straight after domcontentloadedwhite (empty) in 5 of 560 to 75 ms
1.5 s laterred (loaded) in 5 of 5-
After the default gotoredgoto 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

Every wait is your job: a load event, a selector, a fixed delay. The method describes one action and promises nothing about readiness.

Question 3 of 11

Can it capture what is below the fold?

Docs incomplete

What the docs say

“Capture the screenshot beyond the viewport. Defaults to false.”[1]
Protocol, parameter captureBeyondViewport (experimental)

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

CallImageBand at 100 / 1,500 / 2,900 px
No parameters800 x 600viewport only
captureBeyondViewport true, no clip800 x 3,000band 1, 2, 3 (all right)
clip of the whole page, captureBeyondViewport true800 x 3,000band 1, 2, 3 (all right)
clip of the whole page, captureBeyondViewport false800 x 3,000band 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

A white block at the foot of a clipped capture is the sign that the flag was off. Turn it on whenever the clip leaves the window.

Question 4 of 11

Does fullPage give me the whole page?

Docs incomplete

What the docs say

“When `true`, takes a screenshot of the full page.”[3]
Puppeteer, option fullPage

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

CallResult
fullPage: true800 x 3,000, bands right at the top and the foot
fullPage: true, captureBeyondViewport: false800 x 3,000, window back to 800 x 600 afterwards
fullPage: true with cliperror: '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

Leave the flag at its default for full pages. Pick a clip or fullPage, never both.

Question 5 of 11

Does a clip below the fold work by default?

Docs hold

What the docs say

“`false` if there is no `clip`. `true` otherwise.”[3]
Puppeteer, option captureBeyondViewport, default

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

CallResult
Puppeteer, option left out100 x 100, third band (right)
Puppeteer, captureBeyondViewport: falseerror: Cannot take screenshot with 0 height.
Protocol, flag false100 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

Do not set the flag to false when you use a clip. Through the raw protocol, check the pixels yourself.

Question 6 of 11

How tall can a full-page capture be?

Docs silent

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 heightFoot colour rightFileTime
8,000 pxyes26,235 bytes497 ms
16,000 pxyes52,386 bytes531 ms
16,384 pxyes53,651 bytes580 ms
16,385 pxyes53,655 bytes510 ms
20,000 pxyes65,461 bytes778 ms
32,768 pxyes107,217 bytes1,065 ms
40,000 pxyes130,856 bytes1,304 ms
65,536 pxyes214,353 bytes3,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

Before you build on a number, find it yourself in your Chrome. Cap the height on your side so one endless page cannot exhaust memory.

Question 7 of 11

What size is the image when I clip and scale?

Docs incomplete

What the docs say

“Rectangle width in device independent pixels (dip).”[1]
Protocol, type Viewport, width
“Page scale factor.”[1]
Protocol, type Viewport, scale

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 factorclip scale 0.5clip scale 1clip scale 2
1100 x 50200 x 100400 x 200
2200 x 100400 x 200800 x 400
3300 x 150600 x 3001,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

Work out the file size as clip x scale x device scale factor before you store thousands of them.

Question 8 of 11

Which formats does quality apply to?

Run differs

What the docs say

“Compression quality from range [0..100] (jpeg only).”[1]
Protocol, parameter quality
“Quality of the image, between 0-100. Not applicable to `png` images.”[3]
Puppeteer, option quality

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

Formatq 0q 25q 50q 75q 100quality left out
png464,645464,645464,645464,645464,645464,645
jpeg5,29124,76939,96261,203337,45970,911
webp8,00422,38032,05442,586436,50050,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

Use quality for jpeg and webp. Check the range yourself if the value comes from a user.

Question 9 of 11

Does optimizeForSpeed make it faster, and what does it cost?

Docs hold

What the docs say

“Optimize image encoding for speed, not for resulting size (defaults to false)”[1]
Protocol, parameter optimizeForSpeed

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

FormatTime, flag offTime, flag onBytes, flag offBytes, flag on
png199 ms107 ms464,645586,708
jpeg61 ms60 ms70,91170,911
webp133 ms135 ms50,81450,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

A trade of time for bytes, for png only. If you store or send many files, the 26% matters more than the 92 ms.

Question 10 of 11

How do I get a transparent PNG?

Docs hold

What the docs say

“Hides default white background and allows capturing screenshots with transparency.”[3]
Puppeteer, option omitBackground
“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]
Protocol, Emulation.setDefaultBackgroundColorOverride

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)

CallCorner
Puppeteer, defaultwhite (255, 255, 255), opaque
Puppeteer, omitBackground: truetransparent (alpha 0)
Puppeteer, default, right afterwhite again
Puppeteer, omitBackground with type jpegwhite
Protocol, nothing setwhite
Protocol, after the override with alpha 0transparent
Protocol, after clearing the overridewhite

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

Transparency needs png or webp, and a page that does not paint its own background. If you use the protocol alone, set the override first and clear it after.

Question 11 of 11

What does fromSurface change?

Docs silent

What the docs say

“Capture the screenshot from the surface, rather than the view. Defaults to true.”[1]
Protocol and Puppeteer, parameter fromSurface (experimental)

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

ValueImageSame as the default?
left out800 x 600, 464,645 bytes-
truesameidentical string
falsesameidentical string
false, through Puppeteersame sizeyes

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

Leave it alone unless a capture of your own page comes out wrong, and then test both values.

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

For the cost of running Chrome yourself next to an API, read screenshot API vs headless browser: the real cost. For the same capture in eight languages, read website screenshot code examples in 8 languages.

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. [1]Chrome DevTools Protocol, Page.captureScreenshot (Chrome DevTools Protocol, tip-of-tree). Checked .
  2. [2]Chrome DevTools Protocol, Emulation.setDefaultBackgroundColorOverride (Chrome DevTools Protocol, tip-of-tree). Checked .
  3. [3]Puppeteer, ScreenshotOptions interface. Checked .
  4. [4]Puppeteer, Page.screenshot() method. Checked .
  5. [5]Puppeteer, ScreenshotClip interface. Checked .

Screenshot any page in one step

Paste an address into CurlShot and download the screenshot. A free account gives you 50 screenshots every month. No card needed.