Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
AVIF

Taking Screenshots with Puppeteer in GIF, JP2, TIFF, AVIF, HEIF, and SVG

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer’s page.screenshot() directly produces only PNG, JPEG, or WebP. GIF, JP2, TIFF, AVIF, HEIF, and SVG are not members of its documented screenshot format type. Capture a PNG, JPEG, or WebP first, then pass those bytes to a separately selected image converter when you need one of the other formats.

What Puppeteer supports directly

The documented ImageFormat type is 'png' | 'jpeg' | 'webp'. PNG is the default. A screenshot saved with path may infer its type from the filename extension, but an extension does not add an encoder that Puppeteer does not document.

Format Directly supported by page.screenshot()? Correct workflow
PNG Yes; default Capture directly for a lossless raster still.
JPEG Yes Capture directly; the quality option applies where supported.
WebP Yes Capture directly.
GIF No Capture a supported still format, then convert. Do not confuse this with separate screencast recording.
JP2 No Capture first, then use a separately verified JP2 encoder.
TIFF No Capture first, then use a separately verified TIFF encoder.
AVIF No Capture first, then verify that your chosen encoder and runtime support AVIF.
HEIF No Capture first, then verify encoder and native-runtime support.
SVG No Capture first if raster output is acceptable; renaming the file does not create vector artwork.

Capture a page in a supported format

Save a PNG, JPEG, or WebP file

After launching a browser and opening a page, call page.screenshot() with one of the documented formats:

await page.screenshot({ path: 'page.png' });
await page.screenshot({ path: 'page.jpg', type: 'jpeg', quality: 85 });
await page.screenshot({ path: 'page.webp', type: 'webp' });

The method returns screenshot bytes by default. Set encoding: 'base64' only when your downstream pipeline specifically needs a Base64 string.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
SanDisk 128GB Ultra SDXC UHS-I Memory Card - 100MB/s, C10, U1, Full HD, SD Card - SDSDUNR-128G-GN6IN
  • Fast for better pictures and Full HD video. Full HD (1920x1080) video support may vary based upon host device, file attributes, and other factors
  • Great choice for compact to mid-range point-and-shoot cameras
  • From 32GB to 256GB(1) to store tons of pictures and even more Full HD video(2). (1)1GB=1,000,000,000 bytes Actual user storage less
  • Exceptional video recording performance with UHS Speed Class 1 (U1)(5) and Class 10 rating for Full HD video (1080p)(2). (5)UHS Speed Class 1 (U1) designates a performance option to support real time video recording with UHS enabled host devices
  • Quick transfer speeds up to 100MB/s. Up to 100MB/s[64GB-256GB; 90MB/s for 32GB] read speed; write speed lower Based on internal testing; performance may be lower depending on host device, usage conditions, and other factors 1MB=1,000,000 bytes

Capture one element

An element screenshot uses the same underlying screenshot API. Puppeteer scrolls the element into view when needed, so its output formats remain PNG, JPEG, and WebP:

const card = await page.$('.product-card');
await card.screenshot({ path: 'card.png' });

Control the captured area

Options such as fullPage, clip, and background handling change what is captured, not the available encoders. For example:

Rank #2
SANDISK 256GB Ultra SD Memory Card, Up to 150MB/s Read Speeds, UHS-I
  • Great choice for compact to mid-range point-and-shoot cameras
  • Quick transfer speeds up to 150MB/s (Up to 150MB/s read speed engineered with proprietary technology to reach speeds beyond UHS-I 104MB/s, requires compatible devices capable of reaching such speeds. Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
  • Up to 256GB to store tons of pictures (1GB=1,000,000,000 bytes. Actual user storage less.)
  • Exceptional video recording performance with UHS Speed Class 1 (U1) Class 10 rating for Full HD video (1080p) (UHS Speed Class 1 (U1) designates a performance option designed to support real time video recording with UHS enabled host devices. See consumers speed page on SanDisk site. Full HD (1920x1080) video support may vary based upon host device, file attributes, and other factors. Visit the SanDisk Video Knowledge Base for more information.)
  • Compatible with SanDisk SD UHS-I card reader (sold separately)
await page.screenshot({
  path: 'full-page.png',
  fullPage: true,
  omitBackground: true
});

Convert to GIF, JP2, TIFF, AVIF, HEIF, or SVG

Treat conversion as a second, independently verified stage:

  1. Capture PNG, JPEG, or WebP with Puppeteer.
  2. Pass the resulting file or bytes to an image-processing tool whose encoder supports your target format.
  3. Verify the converter’s runtime dependencies, licensing, metadata behavior, transparency handling, color profiles, and output support for your deployment environment.
  4. Inspect the generated file with a decoder that your users or downstream system actually supports.

No particular converter is assumed here: support for all six formats varies by library, platform, and build.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

GIF is not the same as a still screenshot

Puppeteer’s separate screencast documentation describes recording settings such as frame rate, looping, and palette colors. Its GIF palette setting is limited to 256 colors. That recording pathway is distinct from page.screenshot(), whose documented still formats remain PNG, JPEG, and WebP. The screencast reference is on Puppeteer’s Next documentation path, so check the API reference for the exact Puppeteer version installed before relying on it.

Why SVG needs special care

A browser screenshot is a rasterization of the rendered page. Changing page.png to page.svg only changes the name; it does not reconstruct vectors. A separately authored SVG can embed a raster image, but that is not an SVG screenshot encoder provided by Puppeteer.

Rank #4
SANDISK 64GB Extreme PRO SDXC UHS-I Memory Card - C10, U3, V30, 4K UHD, SD Card - SDSDXXU-064G-GN4IN
  • Save time with card offload speeds of up to 200MB/s powered by SanDisk QuickFlow Technology (Up to 200MB/s read speeds, engineered with proprietary technology to reach speeds beyond UHS-I 104MB/s, require compatible devices capable of reaching such speeds. Based on internal testing; performance may be lower depending upon host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes. X = 150KB/sec. SanDisk QuickFlow Technology is only available for 64GB, 128GB, 256GB, 512GB and 1TB capacities. 1GB=1,000,000,000 bytes. 1TB=1,000,000,000,000 bytes. Actual user storage less.)
  • Pair with the SanDisk Professional PRO-READER SD and microSD to achieve maximum speeds (sold separately)
  • Shot speeds up to 90MB/s (Write speed up to 90MB/s. Based on internal testing; performance may be lower depending upon host device. 1MB=1,000,000 bytes. X = 150KB/sec.)
  • Perfect for shooting 4K UHD video and sequential burst mode photography (Full HD (1920x1080) and 4K UHD (3840 x 2160) video support may vary based upon host device, file attributes and other factors. See HD page on SanDisk site.)
  • UHS Speed Class 3 (U3) and Video Speed Class 30 (V30) (UHS Speed Class 3 designates a performance option designed to support 4K UHD video recording with enabled UHS host devices. UHS Video Speed Class 30 (V30), sustained video capture rate of 30MB/s, designates a performance option designed to support real-time video recording with UHS enabled host devices. See the SD Association’s official website.)
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use an in-memory conversion pipeline

When you do not want an intermediate file, keep Puppeteer’s returned bytes in memory and provide them to your converter:

const bytes = await page.screenshot({ type: 'png' });
// Pass `bytes` to a separately selected and verified image encoder.

The returned value is a Uint8Array by default. The converter determines whether the target format, quality controls, animation, metadata, and native dependencies are available.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Or skip the browser setup:

ScreenshotNeo is a website screenshot API and MCP server. It accepts a URL and returns PNG, JPEG, WebP, or PDF; it also handles consent banners and common popups before capture, bills only clean successful shots, and reports the page verdict and billing status in response headers. It does not make Puppeteer’s unsupported GIF, JP2, TIFF, AVIF, HEIF, or SVG encoders available, so those targets still require a verified downstream conversion step.

For API details, see the ScreenshotNeo documentation.

Quick Recap

Bestseller No. 1
SanDisk 128GB Ultra SDXC UHS-I Memory Card - 100MB/s, C10, U1, Full HD, SD Card - SDSDUNR-128G-GN6IN
SanDisk 128GB Ultra SDXC UHS-I Memory Card - 100MB/s, C10, U1, Full HD, SD Card - SDSDUNR-128G-GN6IN
Great choice for compact to mid-range point-and-shoot cameras
$32.49
Bestseller No. 2
SANDISK 256GB Ultra SD Memory Card, Up to 150MB/s Read Speeds, UHS-I
SANDISK 256GB Ultra SD Memory Card, Up to 150MB/s Read Speeds, UHS-I
Great choice for compact to mid-range point-and-shoot cameras; Up to 256GB to store tons of pictures (1GB=1,000,000,000 bytes. Actual user storage less.)
$61.95
SaleBestseller No. 3
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Bottom line for each requested format

  • PNG, JPEG, WebP: use Puppeteer’s screenshot API directly.
  • GIF: use a separate converter for a still, or investigate the version-specific screencast pathway for animation.
  • JP2, TIFF, AVIF, HEIF: capture a supported raster image, then use and verify an encoder for that target.
  • SVG: do not claim a raster screenshot has become vector artwork; create or assemble SVG separately if that is the actual requirement.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.