Fix a Chromium Headless screenshot by identifying which dimension is wrong before changing flags: the requested window size, the page’s CSS viewport, the emulated screen and its device scale factor, or the moment the capture occurs. These are separate layers. Start by recording the browser build and measuring the viewport and screenshot bitmap; then use --window-size for a straightforward CLI capture or virtual-screen configuration when the page must behave as if it is on a particular display.
First identify what is actually the wrong size
A screenshot can look too large or too small for several different reasons. A requested window size is not proof that the page’s CSS viewport or the output bitmap has the same dimensions. Nor does an image that looks visually enlarged necessarily have an incorrect bitmap size.
Record these values separately in a minimal reproduction:
- Requested window bounds: the dimensions passed to the browser, such as
--window-size=1280,800. - CSS viewport: inspect
window.innerWidthandwindow.innerHeightin the page. - Emulated screen: when configured, record the virtual screen dimensions and its device scale factor, or
window.devicePixelRatio. - Screenshot bitmap: inspect the PNG, JPEG or WebP’s actual pixel width and height.
- Visual state: determine whether the page is merely incomplete, still loading, or displaying content at an unexpected CSS scale.
Write down the expected and observed values for each relevant layer. A difference between CSS viewport pixels and screenshot bitmap pixels points toward scale factor or capture configuration; a correct bitmap containing incomplete content points toward readiness or timing instead.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- 1,000mcg of Chromium Per Tablet
- Chromium From Chromium Picolinate
- 240 Tablets In Each Bottle
- Non-GMO, Gluten Free, and Soy Free
- Made in a GMP Compliant, FDA Registered Facility
Record the exact browser and launch path
Before applying a version-specific setting, note the browser version, executable name, operating system or container, headless mode, launch arguments, automation library and version, and whether capture uses Chrome’s CLI, Puppeteer, CDP or another API. Chrome’s headless implementation has changed: precompiled headless_shell binaries have been distributed as chrome-headless-shell through Chrome for Testing since M118; from M132, the old Headless implementation is no longer part of the Chrome binary, so --headless=old has no effect. See the Chromium Headless README.
Set the size for a basic command-line screenshot
For a single static capture, begin with Chrome’s documented CLI combination of --headless, --screenshot and --window-size. The dimensions are comma-separated positive integers; do not add units such as px.
chrome --headless --screenshot --window-size=412,892 https://developer.chrome.com/
The CLI documentation says the default output filename is screenshot.png. Substitute your own browser executable and target URL as needed. See the Chrome Headless command-line reference.
Rank #2
- High-potency Chromium supports sugar, fat and protein metabolism (1)
- Helps maintain blood sugar levels already within a normal range(1)
- Easy dose of just one tablet a day ' an excellent choice for vegetarians
- Non-GMO
- During the summer months products may arrive warm but Amazon stores and ships products in accordance with manufacturers' recommendations, when provided.
Check for a rejected or ignored dimension
Chromium’s current headless command handler parses --window-size=w,h as the initial window size and passes valid dimensions to the screenshot command. Malformed or nonpositive dimensions are rejected; invalid input is logged and ignored. Thus a typo can leave the browser using a default size rather than producing an obviously useful error. Verify that both numbers are present, positive, and separated by a comma, for example --window-size=1280,800, rather than --window-size=1280px,800px. See the current headless command handler; behavior in that moving source may differ from an older installed build.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Do not infer viewport or bitmap size from the flag alone
After capture, inspect the bitmap’s pixel dimensions and evaluate the page’s window.innerWidth, window.innerHeight and window.devicePixelRatio in the same browser run. This tells you whether the requested initial window size, CSS viewport and output image agree. If the CLI image dimensions are wrong, first verify the flag syntax and actual browser build; do not compensate by changing page CSS until you know which layer differs.
Use a virtual screen when display behavior matters
--window-size is a concise way to request screenshot dimensions. If the site’s behavior depends on the characteristics of a display—such as its scale factor, orientation, work area or presence of multiple screens—configure a virtual headless screen instead. Chrome documents that the headless virtual display is independent of physical displays attached to the machine.
Rank #3
- CHROMIUM PICOLINATE: Most optimally absorbed form of essential nutrient Chromium
- HIGH POTENCY: Provides 1,000 mcg of Chromium Picolinate per Vegetarian Tablet
- ROOTED IN WELLNESS: Carlyle provides premium, honest supplements in your pursuit to healthy living
- CARLYLE MANUFACTURERS: Laboratory Tested, Trusted Ingredients, Superior Quality, 100% Guaranteed!
- VEGETARIAN FORMULA: Naturally free of Gluten, Artificial Flavor, Artificial Sweetener, & Non-GMO
The virtual-screen guide describes screen size, scale factor, orientation and work area, and reports devicePixelRatio as part of screen information. It also documents --screen-info for configuring virtual displays. Availability is version-sensitive: Chrome for Developers says virtual headless screen configuration is available in stable Chrome releases starting with version 142. Check the guide against the browser build you actually run before relying on it: Configure virtual screens in Headless mode.
Choose the control that matches the task
| Approach | Controls | Best suited to |
|---|---|---|
--window-size with --screenshot |
Initial window size and a CLI screenshot request | A straightforward static screenshot with a target size |
--screen-info |
Virtual display properties such as size, scale factor, orientation and work area | Pages or tests that need display-aware behavior |
CDP Emulation.addScreen / Emulation.removeScreen |
Adds or removes virtual screens while the browser is running | Automation involving runtime monitor changes |
| Puppeteer screen integration | Virtual screen configuration through Puppeteer support documented by Chrome | Browser tests where screen state belongs in the automation setup |
Use a virtual screen only when that display state is part of the behavior being tested. If the goal is simply a bitmap at a known size, first keep the setup to the CLI screenshot path and verify its output.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Compare scale factor with bitmap dimensions
If the screenshot bitmap is larger or smaller than expected by a consistent ratio, compare its pixel dimensions with the virtual screen’s configured scale factor and reported device pixel ratio. A CSS viewport of one size can correspond to a bitmap with different pixel dimensions when screen scaling is involved. Diagnose the ratio using measured values; do not assume that changing a CSS width, browser zoom or viewport will fix a display-scale mismatch.
Rank #4
- 3rd Party Lab Tested for Purity & Quality
- No Artificial Color, Flavor or Sweetener, No Preservatives, No Sugar, No Starch, No Corn, No Soy, No Egg, No Lactose, No Gluten, No Wheat, No Yeast, No Fish
- 1000 mcg (1mg) of Chromium Picolinate per Tablet - 240 Tablets / Servings per bottle
- Non-GMO & Gluten Free
- TOP QUALITY GMP CERTIFIED PRODUCTS - All Best Naturals products are manufactured in accordance with Good Manufacturing Practices (GMP), among the highest standards in the world -- Proudly Made in USA -- Purity & Potency.
Keep capture timing separate from resolution
When dimensions are right but the image is blank, partially rendered or visually stale, investigate when the capture occurs rather than changing resolution settings. Chrome’s --timeout defines the maximum wait before --screenshot, --dump-dom or --print-to-pdf captures, even if loading continues. --virtual-time-budget advances time-dependent page work such as timers. Neither flag is a resolution control. Details and syntax are in the CLI reference.
Use timing controls only for the condition they address: a timeout can cap how long the browser waits, while virtual time can help pages whose scripted changes depend on timers. If a resource is still loading when capture occurs, increasing or changing a timing setting may affect completeness, but it will not correct a wrong screenshot width or height.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot common scaling and resolution symptoms
| Symptom | Likely layer to check | Next action |
|---|---|---|
The output stays at a default size despite --window-size |
Argument parsing or launch path | Use two positive integers separated by a comma with no units; check logs and confirm the invoked executable and arguments. |
| The screenshot bitmap is the wrong pixel size | Window request, screen configuration or scale factor | Measure bitmap dimensions, CSS viewport and device pixel ratio in the same run; then select CLI sizing or virtual-screen configuration according to the requirement. |
| CSS layout width is wrong although the bitmap is expected | CSS viewport or emulated screen | Read window.innerWidth and window.innerHeight; do not assume bitmap dimensions establish the page viewport. |
| Content appears enlarged or reduced by a ratio | Device scale factor versus bitmap pixels | Compare configured screen scale factor and devicePixelRatio with actual image pixel dimensions before editing CSS. |
| Correct dimensions, but missing or changing content | Capture timing | Check whether the page was still loading; use timeout or virtual-time controls only if their documented timing behavior matches the issue. |
--headless=old does not select the expected implementation |
Browser version and packaging | Identify the binary and version; from M132, old Headless is no longer part of the Chrome binary and that switch has no effect. |
| A virtual screen setting is unavailable or ineffective | Browser version and API path | Check the screen-configuration guide’s version availability and confirm whether the run uses CLI, CDP or documented Puppeteer integration. |
Prepare a useful minimal bug report
If the measured layers still disagree, include the precise browser build, operating system or container, executable name, full flags, Puppeteer or CDP version if applicable, expected CSS viewport, actual CSS viewport, expected bitmap dimensions and actual bitmap dimensions. Include a minimal reproducible page or command. Those facts help distinguish an implementation issue from an invalid flag or a mismatch between viewport and screen configuration.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Best Value
- CHROMIUM PICOLINATE: Receive this essential trace mineral in this high potency formula
- VEGETARIAN FORMULA: Each tablet delivers 1,000 mcg of Chromium Picolinate
- EXPERTLY CRAFTED: Our professional formula is backed by our commitment to purity and potency
- HORBAACH MANUFACTURERS: Laboratory Tested, Trusted Ingredients, Superior Quality, 100% Guaranteed!
- NATURALLY FREE OF: Gluten, Wheat, Milk, Lactose, Artificial Flavor, Preservatives & Non-GMO
Or skip the browser setup
If you need a clean website capture rather than a Chromium display-configuration test, ScreenshotNeo provides a screenshot API and MCP server. One GET request returns an image or PDF; its capture flow accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture. Each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info and capture_pdf for AI agents and MCP clients.
For request options and setup details, see the ScreenshotNeo documentation. This runnable cURL example saves a WebP screenshot:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo also provides 1,000 shots per month free with no card; paid plans start at $5 for 3,000 shots. Those are service-plan allowances, not browser viewport or scale-factor controls. If you need to reproduce a particular virtual display in Chromium, use the configuration steps above. Sign up for ScreenshotNeo to get 1,000 free screenshots a month with no card.
FAQ
Why does a valid window size still produce an unexpected screenshot?
Because the flag requests an initial window size; it does not by itself demonstrate that the CSS viewport, virtual screen scale factor and bitmap dimensions match. Measure those values separately.
Recommended Free Tools
Does --virtual-time-budget change screenshot resolution?
No. It advances time-dependent page code. Use it to address timer-driven readiness, not output dimensions.
Quick Recap
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.

