The most direct way to convert a URL or rendered HTML page to PNG in R is webshot2::webshot(). It drives headless Chrome through Chromote, so you need both the R package and a Chromium-based browser installed.
For a one-page capture, run:
install.packages('webshot2')
webshot2::webshot('https://www.r-project.org/', file = 'page.png')
Choose the conversion route first
HTML-to-PNG conversion in R is normally a browser-rendering task: R opens the page in Chrome, Edge, or Chromium, waits for it to render, and saves the resulting pixels. The right function depends on whether your input is a URL, a local HTML file, or an R Markdown document, and on how much control you need over the browser session.
| Route | Input | Controls | Browser requirement | Best fit |
|---|---|---|---|---|
| ScreenshotNeo | Public URL or HTML/CSS-to-image request | Clean capture, viewport and device settings, selectors, waits, blocking, authentication options, PNG/JPEG/WebP or PDF | None on your machine | API or automated jobs when you want clean shots, only clean shots billed, and a low paid entry plan |
webshot2::webshot() |
URL or rendered HTML page | Viewport, selector, clipping, expansion, delay, zoom, multiple URLs | Chrome, Chromium, Edge, or another Chromium-based browser | Routine screenshots from R |
pagedown::chrome_print() |
URL, local HTML, or rendered R Markdown | PNG/JPEG/PDF format, wait, selector, box model, scale | Google Chrome, Microsoft Edge, or Chromium | Reports and R Markdown workflows |
ChromoteSession$screenshot() |
Anything you navigate in a browser session | Selectors, regions, clipping, scale, delay, format inferred from filename | Chromium-based browser | Fine-grained session scripting |
Legacy webshot::webshot() |
URLs and HTML pages | Viewport and clipping controls documented by the package | Use the backend required by your existing installation | Maintaining older projects |
The package documentation does not provide a controlled speed, fidelity, or success-rate comparison, so choose by input type and control requirements rather than an assumed benchmark.
Install webshot2 and a Chromium browser
Install the R package
install.packages('webshot2')
Load it explicitly when you use it:
library(webshot2)
Install a browser
webshot2 uses headless Chrome through Chromote. Install Google Chrome, Chromium, Microsoft Edge, or another Chromium-based browser that your system can launch. A package installation alone is not enough; without a browser executable, the capture cannot start.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Browser rendering also means that the PNG reflects the browser environment: available fonts, viewport dimensions, device scale, network access, JavaScript execution, and the page’s load state all affect the result.
Basic URL-to-PNG capture with webshot2
Minimal command
webshot2::webshot(
url = 'https://www.r-project.org/',
file = 'r-project.png'
)
The output filename ending in .png makes the intended format clear. The function can also write other image formats supported by the package and browser workflow; use the extension that matches your downstream process.
Set the viewport and capture only the viewport
webshot2::webshot(
url = 'https://example.org',
file = 'example-1280x900.png',
vwidth = 1280,
vheight = 900,
cliprect = 'viewport'
)
vwidth and vheight define the virtual browser viewport. cliprect = 'viewport' restricts the saved image to that viewport instead of extending the capture to the full document.
Capture one element
webshot2::webshot(
url = 'https://example.org',
file = 'article.png',
selector = 'article'
)
Use a CSS selector that exists after the page has rendered. Selector capture is useful for a chart, card, report body, or other region when a full-page image would include unwanted navigation and margins.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Allow dynamic content to finish
webshot2::webshot(
url = 'https://example.org/dashboard',
file = 'dashboard.png',
delay = 3
)
delay adds waiting time before the screenshot. Increase it for pages that populate charts or images asynchronously; there is no universal delay that works for every site. The package reference also documents controls such as expand and zoom for adjusting the captured region and scale.
Capture local HTML and several pages
Local HTML file
webshot2::webshot(
url = 'report.html',
file = 'report.png'
)
Use a path your R process can read. Relative paths resolve from the current working directory, which you can inspect with getwd() or change with setwd(). If the HTML refers to local CSS, JavaScript, or images, keep those paths valid from the document’s location and make sure the browser process can access them.
Several URLs
urls <- c(
'https://example.org',
'https://www.r-project.org/'
)
files <- c('example.png', 'r-project.png')
webshot2::webshot(urls, file = files)
webshot2 accepts a vector of URLs and can capture multiple pages in parallel. Supply a corresponding output path for each page, or follow the package's documented filename behavior for multi-page calls. Keep output names unique so one capture does not overwrite another.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Convert an R Markdown or report page with pagedown
pagedown::chrome_print() is a useful alternative when your source is a report. It accepts a URL or local HTML path and can also work with HTML produced by rendering an R Markdown document. Set format = 'png' and provide an output path.
install.packages('pagedown')
pagedown::chrome_print(
input = 'report.html',
output = 'report.png',
format = 'png'
)
The function also supports JPEG and PDF output. Its documented controls include wait for extra rendering time, selector to target a page element, box_model for element geometry, and scale for output scaling.
Render R Markdown first
- Render the
.Rmdfile to HTML using your normal R Markdown workflow. - Pass the resulting HTML path to
pagedown::chrome_print(). - Set
format = 'png'and choose an output filename ending in.png.
This separates document generation from browser capture, making it easier to inspect the HTML when a chart or table is missing.
Use Chromote directly for session-level control
Chromote is the lower-level option. Create a browser session, navigate with go_to(), then call screenshot() after the page is ready.
b <- chromote::ChromoteSession$new()
b$go_to('https://example.org')
b$screenshot('example.png', selector = 'body')
The screenshot API supports CSS selectors, regions, clipping, scale, and delay. The output format is inferred from the filename (PNG by default); the documented formats include PNG, JPEG, and WebP.
When direct Chromote is worth it
- You need to navigate through several states in one browser session.
- You must choose a region or selector after custom interaction.
- You want direct access to browser-session operations rather than a convenience wrapper.
For a routine one-page URL, webshot2::webshot() generally involves less session code. That is an API-level usability judgment, not a measured performance claim.
What the legacy webshot package means
The older webshot package also documents URL screenshots, viewport dimensions, and clipping. The webshot2 project describes webshot2 as a replacement that uses headless Chrome through Chromote instead of PhantomJS. If an existing application already depends on webshot, verify its current backend and system setup before changing packages; a migration can alter browser availability and rendering behavior.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Control the pixels you get
Viewport versus full document
A viewport capture records what fits in the virtual browser window. A full-page capture includes content below the fold when the package and page permit it. Choose viewport clipping for a fixed-size thumbnail or visual test; choose the full document when the PNG is intended to represent an entire article or report.
Selector and clipping choices
Selector capture is usually more stable than guessing pixel coordinates because it follows the page's layout. If the selector is absent at capture time, the result can be empty or fail. For exact geometry, use the clipping and region controls exposed by webshot2, pagedown, or Chromote and inspect the rendered DOM when coordinates do not match expectations.
Recommended Free Tools
Scale, zoom, and retina output
Scale and zoom change the relationship between CSS pixels and output pixels. Higher output scale can improve legibility but increases file dimensions and memory use. Keep viewport and scale settings consistent across runs when PNGs are used for visual regression or document comparison.
Troubleshooting common failures
“Chrome/Chromium was not found”
Cause: No supported browser is installed, or the browser is not discoverable by the browser-automation layer.
Fix: Install Chrome, Chromium, or Edge; confirm it launches normally; then retry. In managed environments, check the runtime user and executable visibility rather than only your interactive desktop account.
The PNG is blank or only partly rendered
Cause: The page is still loading JavaScript, charts, fonts, or lazy images when the screenshot occurs.
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 errorsFix: Increase delay in webshot2 or wait in pagedown. For a specific element, wait until its content is present before capturing. A longer delay is a practical adjustment, not a guarantee for every application.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
A selector returns nothing
Cause: The selector is wrong, the element is inside a later-rendered component, or the page uses a different DOM on mobile-sized viewports.
Fix: Inspect the rendered page, use the final CSS selector, and make the viewport explicit. Capture the full page once to confirm that the element exists before narrowing to a selector.
Local images or styles are missing
Cause: Relative asset paths resolve differently for a browser launched by R, or the process cannot read the files.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Fix: Use correct paths relative to the HTML document, keep assets alongside the document, and test the HTML in the same filesystem context. A local file that looks correct in an editor can still reference an inaccessible asset.
The process times out or consumes too much memory
Cause: Very tall pages, large images, many parallel browser tabs, or a page that never reaches a settled state.
Fix: Capture a selector or viewport instead of an unlimited document, reduce scale, process batches, and avoid an unnecessarily long delay. If the site itself never finishes loading, diagnose the page independently of the screenshot function.
Anti-bot or consent overlays obscure the page
Cause: The target serves a challenge, cookie banner, newsletter modal, or chat widget to automated browsers.
Free tools Windows power users keep installed
One-click scans. No signup required.
Fix: For local work, handle the page state in the browser workflow and capture only after the overlay is gone. For a managed API that removes common consent and overlay elements, see the alternative below.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Reliability, repeatability, and cost considerations
- Rendering environment: Pin the browser family, viewport, scale, and fonts when comparing PNGs over time.
- Page state: Dynamic content, network speed, and lazy loading can change the pixels even when the URL is unchanged.
- Parallel work: Vectorized webshot2 calls can capture multiple URLs in parallel, but concurrency increases browser and memory demand.
- Waiting: Delays improve the chance that asynchronous content appears, while also increasing total runtime.
- Evidence limits: The package references do not publish a numerical benchmark for speed, fidelity, or success rate, so measure your own pages if those metrics matter.
- Licensing and infrastructure: The R packages are software dependencies; the documented requirement is a compatible browser, not a particular computer accessory or paid hardware purchase.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server for developers. It accepts a URL and returns a PNG, JPEG, WebP, or PDF without requiring Chrome or Chromium on your machine. A single GET request is enough:
See the ScreenshotNeo API documentation for all parameters.
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}`);
ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before the capture; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in X-Page-Verdict and X-Billed headers.
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 & 11It also offers full-page captures with lazy images loaded, CSS-selector element shots, dark mode, 12 device presets or custom viewports, retina scale, PDF paper and page controls, custom CSS and JavaScript, click-before-capture, selector hiding, waits for selectors or network idle, ad/tracker/request blocking, custom headers and cookies, user-agent and Authorization settings, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, an OpenAPI specification, and compatibility with parameter names used by other screenshot APIs.
An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients, so an AI agent can request captures directly.
The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing provides two months free, and every feature is included on every plan. Create a free ScreenshotNeo account to begin.
Frequently Asked Questions
Does the PNG preserve the browser’s exact appearance?
It preserves the rendered pixels produced by the chosen browser environment, not the source HTML text. Fonts, viewport, device scale, JavaScript state, and network timing can therefore change the image.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Which option is best for a rendered R Markdown report?
Render the document to HTML, then use pagedown::chrome_print() when you want report-oriented wait, selector, box-model, and scale controls.
Can I claim that one R package is fastest?
No. The package references describe capabilities but do not provide a controlled speed or fidelity benchmark; test representative pages in your own environment if performance is a requirement.
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.




