Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsIf captureSelector() produces a blurry, tiny, or badly cropped image, fix the rendered page before changing JPEG quality. Set an explicit viewport, wait for the new viewport and final layout, capture a precisely sized visible selector, and use PNG for text and interface detail. A selector capture clips the pixels PhantomJS rendered; it does not create extra resolution.
Why captureSelector screenshots look poor
CasperJS delegates rendering to PhantomJS. PhantomJS starts with a documented 400×300 viewport, and CasperJS does not override that default. At that size, responsive CSS may switch to a mobile layout, columns may collapse, and the target element may be rendered at only a few hundred pixels wide. captureSelector() then saves that small rendered area exactly as it exists.
There are five separate causes to check:
- Rendered dimensions: the viewport or the element’s own CSS width is too small.
- Responsive layout: media queries select a compact layout at the current viewport.
- Timing: fonts, images, JavaScript components, or client-side data have not finished rendering.
- Selector bounds: padding, transforms, overflow, or an unexpected wrapper changes the captured rectangle.
- Encoding and versions: JPEG artifacts, or differences between old CasperJS and PhantomJS releases, affect the result.
Changing quality cannot restore pixels that were never rendered. Diagnose in that order so you do not mistake compression for a layout problem.
A reliable captureSelector procedure
1. Choose the intended browser viewport
Pick dimensions that represent the page you want to document, such as a desktop layout or a specific device width. The example below uses 1440×900 only as a starting point; it is not a universal “high quality” setting. A wider viewport can change the target’s responsive layout, so record the dimensions with each screenshot build.
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 →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
2. Apply the viewport asynchronously
viewport(width, height) must complete before the page is captured. Chaining the next operation in its completion callback ensures that media queries and layout calculations use the new size.
3. Wait for the target and its content
Wait for the selector after opening the page. If the element appears before its images or client-rendered content, add a targeted wait for those conditions or a short delay. Keep pageSettings.loadImages enabled when image content is part of the screenshot.
4. Capture the smallest correct selector
Select the element whose visible bounds are the intended output. A page wrapper can include large padding, a transformed child, or an overflow region that makes the result look cropped or oddly scaled. Inspect the element in the page’s computed layout when diagnosing a mismatch.
5. Select format and quality explicitly
Use PNG for text, charts, icons, and UI edges. Use JPEG when file size matters and photographic content dominates; choose a high quality value, but remember that JPEG quality only controls compression of the existing pixels.
var casper = require('casper').create({
pageSettings: { loadImages: true }
});
var url = 'https://example.com';
casper.start(url, function () {
this.viewport(1440, 900).then(function () {
this.waitForSelector('#target', function () {
this.captureSelector('target.png', '#target', {
format: 'png',
quality: 100
});
}, function () {
this.die('The target selector did not appear before the timeout.');
});
});
});
casper.run();
Replace https://example.com and #target with your page and selector. The documented quality range is 1–100. For PNG, the important improvement is usually the rendered viewport and timing rather than a quality number.
Make the selector’s pixels larger without changing the design
Use a wider viewport when responsive CSS is shrinking the component
If the target is rendered in a narrow column, compare a desktop viewport with the production viewport. A larger viewport may select a desktop breakpoint and give the element more CSS pixels. Do not simply enlarge the output file afterward: that scales existing pixels and leaves text soft.
Check CSS transforms and device scaling
A parent or target with transform: scale(...) can make its visual content smaller than its layout box. Inspect both the element’s bounding rectangle and computed transform. Capture the unscaled element, or remove the transform for a documentation-only run if that is acceptable.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Separate clipping from rendering
captureSelector() captures the page area containing the selector. To determine whether the selector logic is responsible, capture the same region with capture() and a clipRect. If both images are soft, the page was rendered at insufficient size or with insufficient raster detail. If only the selector result is wrong, investigate the selector’s bounds, overflow, and transforms.
Free tools Windows power users keep installed
One-click scans. No signup required.
Format, quality, and alternative capture APIs
| Need | Recommended approach | Reason |
|---|---|---|
| Crisp text and interface edges | PNG with explicit format: 'png' |
Lossless encoding avoids JPEG ringing around letters and thin lines. |
| Smaller photographic files | JPEG with a high quality value |
Reduces size, but introduces compression artifacts. |
| Diagnose selector clipping | capture() plus clipRect |
Compares a rectangle capture with selector-derived bounds. |
| Embed output in another response | captureBase64() |
Supports a whole page or an area specified by selector, clip rectangle, or selector object. |
captureBase64() supports BMP, JPG/JPEG, PNG, PPM, TIFF, XBM, and XPM. Use a format your downstream system can decode; PNG remains the conservative choice for text-heavy output.
Complete diagnostic checklist
- Record the exact CasperJS and PhantomJS versions, URL, selector, viewport, and output format.
- Set
pageSettings.loadImages: trueif images are required. - Apply
viewport(width, height)and wait for its asynchronous completion. - Wait for the target selector and any page-specific rendering condition.
- Inspect the target’s rendered width and height, including padding, overflow, and transforms.
- Capture PNG at quality 100 for a clean baseline.
- Compare
captureSelector()withcapture()using a matchingclipRect. - Only after the baseline is correct, test JPEG quality or a different file extension.
Version differences: what to verify
Legacy PhantomJS and CasperJS releases can produce different rendering results. One Stack Overflow report described poor selector output with PhantomJS 1.9.7 and CasperJS 1.0.2, followed by an improvement after upgrading to PhantomJS 1.9.8 and CasperJS 1.1.0-beta3. That is a single community report, not a compatibility guarantee. Treat it as a troubleshooting lead: reproduce your case after recording versions, and change one component at a time. A version change can alter fonts, CSS support, timing, or image rasterization, so keep a before-and-after sample.
Common failures and fixes
The image is tiny even at quality 100
Cause: the page or selector was rendered at a small CSS size, often because the 400×300 default viewport triggered responsive rules.
Fix: set and await an explicit viewport, then inspect the selector’s rendered bounds. Do not upscale the saved bitmap as a substitute.
The target is cut off
Cause: the selector’s box does not include the visible content, or a parent uses overflow, padding, or transforms.
Fix: capture a simpler inner selector, inspect its bounding rectangle, and compare with a capture() clip rectangle.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Images or charts are missing
Cause: capture occurred before assets or client-side rendering completed.
Fix: keep loadImages enabled, wait for a selector that appears only after rendering, and add a narrowly scoped delay when the page has no reliable ready signal.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The layout is mobile when a desktop shot is expected
Cause: the viewport width selected a mobile media-query breakpoint.
Fix: use the intended desktop width and await the viewport change before opening the capture step. Validate that the chosen width matches your documentation requirement.
PNG is sharp but JPEG has halos
Cause: JPEG compression around high-contrast text and UI edges.
Fix: use PNG, or raise JPEG quality and accept the larger file. No quality setting can recover detail lost during rendering.
Recommended Free Tools
An upgrade changes the screenshot unexpectedly
Cause: renderer behavior, font handling, or CSS support differs between versions.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Fix: pin the versions used in your capture environment, compare a known URL, and verify the target page at the new versions before changing production jobs.
Performance and repeatability
A larger viewport increases the number of pixels to render and encode. Full-page or image-heavy pages also take longer when images are enabled. Use the smallest viewport that still represents the layout you need, wait on a meaningful selector instead of an arbitrary long delay, and capture only the target element when a component image is sufficient.
For stable builds, keep URL, viewport, user agent, font environment, CasperJS version, PhantomJS version, selector, format, and quality under configuration control. Save failures with their error text and a diagnostic full-page capture. This makes a “blurry” report distinguishable from a changed layout, missing asset, or timeout.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchOr skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server for developers. One request returns a PNG, JPEG, WebP, or PDF, while its capture pipeline accepts cookie and consent banners before removing more than 60 known consent platforms, newsletter popups, and chat widgets. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed as clean shots; response headers identify the page verdict and billing status. Its MCP tools—take_screenshot, get_page_info, and capture_pdf—let Claude, Cursor, or another MCP client request captures without custom browser orchestration.
Example cURL request (see the ScreenshotNeo documentation):
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
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)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo also supports full-page captures with lazy images loaded, CSS-selector element shots, dark mode, device presets, arbitrary viewports, retina scale, custom CSS and JavaScript, click actions, selector or network-idle waits, blocked requests, custom headers and cookies, timezone and geolocation, transparent backgrounds, resizing, cache TTLs, signed links, asynchronous webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Every feature is available on every plan: 1,000 shots per month are free with no card; paid plans start at $5 for 3,000 shots, with yearly billing providing two months free.
Create a free ScreenshotNeo account and start with the 1,000 monthly shots without a card.
FAQ
Does captureSelector support a CSS selector?
Yes. Its second argument is a CSS selector, and the method saves the page area containing the matching element.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Can I capture formats other than PNG and JPEG?
Yes. captureBase64() documents BMP, JPG/JPEG, PNG, PPM, TIFF, XBM, and XPM support. Set the format explicitly when relying on a format rather than a filename extension.
Is there a numeric sharpness gain from a particular viewport?
No universal benchmark establishes one. Choose dimensions that produce the layout and rendered pixel size your use case requires, then verify the output in your own environment.
Should I upgrade CasperJS or PhantomJS first?
Record both versions, reproduce the problem, and test a controlled upgrade. The reported improvement from PhantomJS 1.9.7/CasperJS 1.0.2 to PhantomJS 1.9.8/CasperJS 1.1.0-beta3 is anecdotal rather than a guarantee.
Frequently Asked Questions
Does captureSelector support a CSS selector?
Yes. Its second argument is a CSS selector, and the method saves the page area containing the matching element.
Can I capture formats other than PNG and JPEG?
Yes. captureBase64() documents BMP, JPG/JPEG, PNG, PPM, TIFF, XBM, and XPM support.
Is there a numeric sharpness gain from a particular viewport?
No universal benchmark establishes one; choose dimensions that produce the required layout and rendered pixel size.
Should I upgrade CasperJS or PhantomJS first?
Record both versions, reproduce the problem, and test a controlled upgrade because the reported upgrade benefit is anecdotal.
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.

