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
World desk5 min

How to Capture Website Thumbnails at a Custom Viewport Size

Set the viewport before navigating, then capture the visible page at the exact browser dimensions your thumbnail needs.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the browser viewport width and height before opening the page, then capture the visible viewport. In Playwright, that means page.setViewportSize() followed by page.screenshot(). Use fullPage: true only when the thumbnail is meant to show the entire scrollable page rather than the browser-sized view.

Capture a thumbnail at a specific width and height with Playwright

This JavaScript example opens Chromium, sets a 1200 × 800 CSS-pixel viewport before navigation, waits for the page load event, and saves the visible viewport as a PNG:

As an Amazon Associate I earn from qualifying purchases.

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  const page = await browser.newPage();

  await page.setViewportSize({ width: 1200, height: 800 });
  await page.goto('https://example.com', { waitUntil: 'load' });
  await page.screenshot({
    path: 'thumbnail.png',
    fullPage: false,
    scale: 'css',
  });

  await browser.close();
})();

Install Playwright and its browser binaries in your project before running the script. Replace the example URL and dimensions with your target page and intended thumbnail size. The viewport values are in pixels; Playwright advises setting the viewport before navigation when possible because websites may adapt their layout as they load. See the Playwright Page API.

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

Set the viewport in the browser context instead

If every page in a browser context should use the same dimensions, pass the viewport when creating the context:

#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black | 1080p with auto-Light Correction, Built-in mic, Privacy Shutter, USB-A, Compatible with Teams, Google Meet, Zoom and More
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
const context = await browser.newContext({
  viewport: { width: 1200, height: 800 },
});
const page = await context.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'thumbnail.png', fullPage: false });

This is useful for repeated captures at a fixed breakpoint. For a different breakpoint, set a different viewport or create another context. Playwright documents context viewport and device emulation in its Emulation guide.

Choose the right capture area and pixel scale

Viewport, full page, or clipped region

  • Viewport screenshot: The default screenshot represents what fits in the current viewport. This is usually the right choice for a thumbnail.
  • Full-page screenshot: Set fullPage: true to capture the full scrollable page. This produces a taller image, not a conventional fixed-size viewport thumbnail.
  • Clipped screenshot: Use the screenshot API’s clip option when you need a specific region rather than the whole viewport.

Playwright explains the difference between viewport and full-page images in its Screenshots guide.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

CSS pixels versus device pixels

The screenshot option scale controls output density. With scale: 'css', the image has one raster pixel per CSS pixel; with scale: 'device', output follows device pixels and can be larger on a high-density display. Choose CSS scale when the required output dimensions must match the configured viewport. Choose device scale when higher-density rendering matters more than a one-to-one output size.

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

When viewport size is not enough

A viewport defines the page’s layout area, but it does not by itself reproduce every aspect of a phone or other device. If the result depends on device scale factor, screen dimensions, or mobile behavior, configure the relevant context emulation options as well. Playwright’s device emulation documentation describes these settings and notes that a device profile’s viewport can be overridden.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Capture several thumbnail sizes consistently

For breakpoint previews, capture each width and height deliberately rather than resizing an already-created image. A small helper keeps the viewport configuration explicit for each capture:

async function captureAt(page, url, width, height, path) {
  await page.setViewportSize({ width, height });
  await page.goto(url, { waitUntil: 'load' });
  await page.screenshot({ path, fullPage: false, scale: 'css' });
}

await captureAt(page, 'https://example.com', 1200, 800, 'desktop.png');
await captureAt(page, 'https://example.com', 390, 844, 'narrow.png');

The same URL can lay out differently at each viewport, so capture it anew after changing dimensions. If the intended output emulates a device rather than only a responsive breakpoint, configure that device’s other relevant settings too.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera | USB Type-A & A-to-C Adapter, Fixed Focus, Plug&Play for Zoom/Teams/Facetime/YouTube/Google Meet/Switch 2 Camera, 2025 Version
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

Use Chrome DevTools Protocol for lower-level control

If you are issuing Chromium commands directly instead of using Playwright, the Chrome DevTools Protocol provides Page.setDeviceMetricsOverride for dimensions and device scale factor, and Page.captureScreenshot for the image. The capture command supports PNG, JPEG, and WebP, as well as clipping and a captureBeyondViewport option. Consult the Chrome DevTools Protocol Page reference for the current protocol details; its tot documentation is a rolling reference, so check compatibility with the Chromium version you use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common thumbnail problems

  • The page uses the wrong responsive layout: Set the viewport before calling goto(). Also check whether you need mobile emulation rather than viewport dimensions alone.
  • The saved image has unexpected dimensions: Check fullPage, scale, and any clip setting. CSS scale yields one output pixel per CSS pixel; device scale can yield a larger raster image.
  • The thumbnail cuts off content: A normal viewport screenshot intentionally captures only the visible area. Set fullPage: true for the entire scrollable page, or use clipping for a deliberate region.
  • The screenshot is captured before the page is ready: Navigation completion does not guarantee that every delayed image or client-rendered component has appeared. Wait for a relevant selector or an appropriate delay before capture; the right condition depends on the target site.
  • Changing dimensions does not change the result as expected: Verify the size was set on the page or context used for that capture, and set it before navigation. For device-specific behavior, configure screen, device scale factor, and mobile behavior as needed.

Or skip the browser setup

ScreenshotNeo provides a one-request screenshot API. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

For API options and setup, see the ScreenshotNeo documentation. Example cURL request:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

For a custom viewport, add the viewport parameters supported by the API as described in its documentation. Visit ScreenshotNeo or sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Should I use full-page capture for a website thumbnail?

Usually not: use the normal viewport capture for a fixed-size preview. Choose full-page only when the thumbnail is intended to show the whole scrollable document.

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

Does a 1200 × 800 viewport always create a 1200 × 800 image?

With Playwright’s CSS scale, it produces one raster pixel per CSS pixel for a viewport capture. Device scale can produce a larger output, and full-page or clipped captures can change the final dimensions.

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.