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 DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

How to Capture Lazy-Loaded Background Images in a Website Screenshot

A full-page screenshot does not necessarily trigger scroll-based CSS backgrounds. Use Playwright to scroll the page, wait for the site’s readiness condition, and then capture.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Scroll the live page through the sections that load their CSS background images, wait for the site to apply those images and for them to render, then take the full-page screenshot. Setting fullPage: true captures the page’s scrollable area; it does not by itself guarantee that scroll-triggered content has loaded.

Why a full-page screenshot can miss background images

Many sites defer background images until a section approaches the viewport. JavaScript may use an IntersectionObserver callback to add a class or set an element’s background-image. If the browser has not scrolled that element through the relevant viewport, the callback may not run before capture.

As an Amazon Associate I earn from qualifying purchases.

Full-page capture and content activation are separate steps. Playwright’s fullPage: true option captures the full scrollable page, but it is not a promise that the browser will first simulate scrolling through the document. Similarly, waiting for the page’s load event is not proof that deferred imagery is ready: lazy-loaded media may still be pending.

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

Scroll the page, wait, then capture with Playwright

This Node.js example scrolls the top-level page in increments smaller than the viewport, gives rendering and intersection callbacks a chance to run, returns to the top, and captures the full page. It is a starting pattern; adjust the wait or use a page-specific readiness check when the site needs more time.

#1 Best Overall
Sale
Capture Card, 4K HDMI Video Capture Card, Game Capture Card, 1080P 60FPS Video Capture Device, HDMI to USB 3.0 Capture Card for Streaming, Work with Camera/Xbox/PS4/PS5/PC/OBS
  • 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
  • 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
  • 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
  • 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
  • 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.
const { chromium } = require('playwright');

(async () => {
  const url = 'https://example.com';
  const browser = await chromium.launch();
  const page = await browser.newPage();

  try {
    await page.goto(url, { waitUntil: 'domcontentloaded' });

    await page.evaluate(async () => {
      const step = Math.max(300, Math.floor(window.innerHeight * 0.8));
      const maxScroll = Math.max(
        document.documentElement.scrollHeight,
        document.body.scrollHeight
      );

      for (let y = 0; y < maxScroll; y += step) {
        window.scrollTo(0, y);
        await new Promise((resolve) => requestAnimationFrame(() =>
          requestAnimationFrame(resolve)
        ));
        await new Promise((resolve) => setTimeout(resolve, 150));
      }

      window.scrollTo(0, 0);
      await new Promise((resolve) => requestAnimationFrame(() =>
        requestAnimationFrame(resolve)
      ));
    });

    await page.screenshot({ path: 'page.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

Install Playwright in your project with npm install playwright. Depending on your setup, you may also need to install its browser binaries with npx playwright install. Replace the example URL with the page you need to capture.

Make readiness explicit when the page allows it

The two animation frames in the example give the browser a rendering opportunity; the 150 ms pause is only a small delay, not a guarantee that network requests have finished. For repeatable captures, prefer an application-ready condition: for example, wait until a known background URL appears in computed style, or until the application signals that the relevant sections are ready. If the site is slow, increase the delay or wait for its specific condition rather than assuming one fixed timeout works everywhere.

Rank #2
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS | Capture Card for Streaming, Compatible with iPad Mac OS Windows, Quest 3, OBS, PS5/4, Switch2/1, Xbox, Camera (Silver)
  • 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
  • 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
  • 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
  • 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
  • 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0

Handle nested scrolling and pages that grow

If the target sections live inside an independently scrolling element, scrolling window may never bring them into the observer’s root. Scroll the relevant container through its content as well. Intersection observers can use a configured root, including nested scroll containers, so the element must cross the boundary that the site actually observes.

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

For infinite-scroll pages, the document may grow as you move down it. Re-check the height during traversal and set a deliberate stopping condition, such as a known last item or a maximum number of passes; otherwise the capture preparation can keep chasing new content.

Rank #3
Sale
Elgato 4K S Capture Card for PS5, Xbox Series X/S, Switch 2 | 4K60 capture, 1440p120 or 1080p240 passthrough, HDR10 support, Near-zero latency, USB-C, Analog audio input
  • 4K60 Capture: Record in cinematic quality with crisp detail and vivid colors
  • HFR Support: Play and capture in 1440p120 or 1080p240
  • HDR10 Support: Capture brilliant HDR content with tone mapping on Windows
  • Cross-Platform Compatible: Works with PS5, Xbox Series X/S, Switch 2, and more
  • Analog Audio In: Capture in-game chat or commentary with 3.5mm input

Confirm that the background is ready

When a region is blank, inspect its element’s computed background-image before and after scrolling. A placeholder or none that changes to a URL after the element enters view is evidence that deferred assignment occurred. CSS can contain multiple comma-separated background layers, so check for all expected URLs rather than only the first.

If the expected URL is present but the captured area remains blank, the assignment may have succeeded while the image request is still pending or failing, the element may be hidden or covered, or capture may happen before the result is painted. For a known URL, you can test whether that particular resource loads and decodes with an Image object:

Rank #4
Sale
Capture Card 4K HDMI Video Streaming to USB 3.0 1080P 60FPS Capture Device | Audio Video Capture, 4K HDMI Loop-Out, Work for PS5/PS4/Switch/Xbox/PC/Camera/OBS, Game Screen Recorder Streaming Equipment
  • High-Quality Video Capture, 4K HDMI Capture Card Ready: Capture smooth and vibrant video with this 4K HDMI capture card, engineered for gamers and content creators who demand crisp 1080P 60FPS video quality. Whether you're streaming to Twitch or recording gameplay for YouTube, your footage will look professional and detailed
  • Plug-and-Play USB Capture Card, No Drivers Needed: Designed as a USB capture card for streaming, this device works instantly out of the box, just plug into your PC or laptop and start capturing. Fully compatible with popular software like OBS Studio, Streamlabs, and XSplit, making setup quick and stress-free for beginners and pros alike
  • Universal Compatibility PS5, Xbox, Switch & More: Stream or record gameplay from virtually any HDMI-enabled device including Nintendo Switch, PS5, Xbox Series X, DSLR cameras, and PCs. The video capture card for gaming supports seamless passthrough so you can play without lag while your audience watches every frame in real time
  • Low-Latency Performance for Smooth Streaming: This capture card for streaming minimizes delay between gameplay and broadcast, so you get reliable, low-latency capture that works well for competitive gaming, live broadcasts, and podcast sessions. Suitable for those building their channel with high-quality, engaging content
  • Compact & Portable Design for Content Creators: Lightweight and portable, this USB 3.0 capture card works well for creators who travel or switch gaming setups often. Throw it in your bag and stream or record wherever you are, at home, events, LAN parties, streaming or studio sessions
const result = await page.evaluate(async (url) => {
  const image = new Image();
  image.src = url;

  try {
    await image.decode();
    return { loaded: true, width: image.naturalWidth, height: image.naturalHeight };
  } catch (error) {
    return { loaded: false, error: String(error) };
  }
}, 'https://example.com/path/to/background.jpg');

console.log(result);

This checks only that URL, not every layer, the page’s final visual state, or whether the site actually applied it to the intended element.

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

Choose a preparation method that fits the page

Workflow Completeness Runtime and robustness
Capture without scrolling Fast, but viewport-triggered backgrounds may remain deferred. Shortest workflow; unsuitable when content must intersect a viewport to load.
Scroll and use a fixed wait Triggers many viewport-based implementations, but can still miss slow or site-specific behavior. Simple to add; runtime grows with page length and wait time. Nested scrollers and infinite content need additional handling.
Scroll and wait for an application-ready signal Can be more deterministic when the site exposes a reliable condition for the expected content. Requires a suitable signal and may need site-specific logic; nested scrolling and infinite content still require deliberate handling.

These are workflow trade-offs, not benchmark results. For a small static page, a brief scroll routine may be enough. For visual regression or repeatable test runs, an explicit readiness condition is preferable to relying only on a delay.

Troubleshooting missing backgrounds

  • The background stays none after scrolling: Check whether the element crossed the observer’s viewport or configured root. Look for an inner scroll container and inspect the site’s class or style changes.
  • The URL appears, but the area is blank: Check whether the request succeeds, whether the element is visible and unobscured, and whether capture waits until after rendering.
  • Only some sections load: Increase the traversal coverage or wait, and check for different observer roots or per-section loading behavior.
  • The last sections are missing on an infinite page: Re-check document height as content is added and stop only after the intended content has appeared.
  • waitUntil: 'load' still produces blanks: Treat it as navigation readiness, not proof that lazy content is ready. Wait for the page-specific background or application signal instead.

Or skip the browser setup

ScreenshotNeo is a website screenshot API with full-page capture and lazy images loaded. A single request can return a screenshot or PDF; use its documented full-page option when you need the whole page. Cookie banners, popups and chat widgets are removed before the shot, and bot checks, blank pages and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. See the API documentation for request options.

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

Sign up for 1,000 free screenshots a month, with no card required.

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.

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

Leave a Reply

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

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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
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.