To convert a webpage or HTML file to JPG, render it in a browser (or an HTML renderer) and capture the rendered pixels as a JPEG. For most modern pages, Playwright or Puppeteer gives the best control over full-page capture, clipping, waiting, viewport size, and JPEG quality. Chrome Headless is convenient from a shell, while wkhtmltoimage can convert local HTML with explicit local-file permissions.
Choose the right conversion route
Your input and the capture controls you need determine the tool. HTML source is not itself a photograph: CSS, fonts, images, scripts, and layout must be rendered before an image can be encoded.
| Route | Input | Useful controls | Important qualification |
|---|---|---|---|
| Playwright | URL, local file, or page content | JPEG/PNG/WebP, full page, clip, viewport, device scale, quality, waits, CSS and JavaScript | JPEG quality defaults to 80; JPEG cannot preserve transparency. |
| Puppeteer | URL, local file, or page content | JPEG/PNG/WebP, full page, quality, viewport and filename-based format | Use an explicit filename extension or format option so the output is unambiguous. |
| Chrome Headless | URL or file URL | Command-line screenshot, window size, timeout | The documented example writes PNG; use Playwright or Puppeteer when you need directly documented JPEG output. |
| wkhtmltoimage | HTML input file or URL | Image conversion and local-path allowlisting | Its Debian manual is old, so verify compatibility with current CSS and JavaScript before adopting it. |
| Browsershot | URL or HTML input | PHP-oriented wrapper around Puppeteer and headless Chrome | Check the project’s current dependency requirements before setup. |
Convert a webpage to JPG with Playwright
Playwright is the most flexible general-purpose choice when the page is dynamic or the output must be reproducible. The following Node.js example opens a URL, waits for network activity to quiet down, captures the complete scrollable page, and writes a JPEG.
import { chromium } from 'playwright';
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage({
viewport: { width: 1440, height: 900 },
deviceScaleFactor: 1
});
await page.goto('https://example.com', { waitUntil: 'domcontentloaded', timeout: 60000 });
await page.waitForLoadState('networkidle');
await page.screenshot({
path: 'page.jpg',
type: 'jpeg',
quality: 85,
fullPage: true
});
await browser.close();
Install Playwright with npm install playwright. Its browser binaries may require the project’s documented install step. Replace the URL and run the file with Node.js.
#1 Best Overall
- AUDIO ALL-ROUNDER – convert your audio or video files into almost any audio format - edit, trim, merge, adjust sample and bit rate, extract audio from videos
- Supported input formats - MP3, MP2, AAC, AC3, WAV, WMA, M4A, RM, RAM, OGG, AU, AIF, AIFF, PG, MPEG, MPEG 2, MP4, M4V, MJPG, MJPEG, HD TS, HD MTS, HD M2TS, HD MPG, HD MPEG, HD MP4, HD WMV, QuickTime HD MOV and others
- Supported output formats - AAC, AC3, AIFF, AMR, AU, FLAC, M4A, MKA, MP2, MP3, OGG, WAV, WMA
- EASY TO INSTALL AND USE - user-friendly and intuitive interface, free tech support whenever you need assistance
- compatible with Windows 10, 8 and 7 (32 and 64-bit versions) - single user license
Capture only the visible viewport
Set fullPage: false (the default) to save only the current viewport. This is appropriate for a hero image, dashboard snapshot, or social preview where a very tall image is undesirable.
Capture one element or a clipped rectangle
For an element, locate it and pass its bounding box to clip:
const card = page.locator('.pricing-card').first();
const box = await card.boundingBox();
if (!box) throw new Error('Element is not visible');
await page.screenshot({
path: 'card.jpg',
type: 'jpeg',
quality: 90,
clip: box
});
Clipping uses CSS-pixel coordinates. A higher deviceScaleFactor produces more device pixels for the same CSS viewport, useful for high-density displays but larger files.
Wait for images, fonts, and application state
networkidle helps with pages that continue loading after the initial HTML, but it is not a universal “everything is finished” guarantee. For a known component, wait for its selector and, when necessary, add a short delay for animation or lazy loading:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesawait page.waitForSelector('#report', { state: 'visible', timeout: 30000 });
await page.waitForTimeout(500);
await page.screenshot({ path: 'report.jpg', type: 'jpeg', quality: 85, fullPage: true });
If a page lazy-loads images only while scrolling, use full-page capture and confirm that the images are present before saving. You can also inject CSS to disable transitions or hide unwanted elements before the screenshot.
Rank #2
- Convert your PDF files into Word, Excel & Co. the easy way
- Convert scanned documents thanks to our new 2022 OCR technology
- Adjustable conversion settings
- No subscription! Lifetime license!
- Compatible with Windows 11, 10, 8.1, 7 - Internet connection required
Render HTML held in memory
await page.setContent(`
Invoice
Generated at runtime.
`, { waitUntil: 'networkidle' });
await page.screenshot({ path: 'invoice.jpg', type: 'jpeg', quality: 92 });
External images, fonts, or styles in that HTML still need reachable URLs. For a local document, use a correctly formed file:// URL and ensure referenced assets are readable, or serve the directory over a local HTTP server.
Use Puppeteer when it is already in your Node stack
Puppeteer exposes the same essential JPEG controls and can infer the format from the output filename. This complete example captures a full page:
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
await page.goto('https://example.com', { waitUntil: 'networkidle2', timeout: 60000 });
await page.screenshot({
path: 'page.jpg',
type: 'jpeg',
quality: 85,
fullPage: true
});
await browser.close();
Install it with npm install puppeteer. Use clip for a region, omit fullPage for the viewport, and set a larger device scale when you need extra pixel density.
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 →Repair Windows errors before they cause bigger problemsFix Now →Command-line alternatives
Chrome Headless
Chrome’s headless reference documents a shell screenshot route and a window-size setting:
google-chrome --headless --screenshot=screenshot.png --window-size=1440,900 https://example.com
The --timeout option sets the maximum wait before capture while a page may still be loading:
Rank #3
- AV TO USB Converter: Capture videos and audios from VHS, VCR, Hi8, DV tapes to a PC, with the help of our USB Video Converter. Save room while digitizing your favorite old memories
- Quality Capture Card: Our USB Video Capture Card converting anolog RCA composite input into HD 720P USB output and capturing audio without any sound card. Advanced signal processing technology provides you with great precision, colors, resolutions, and details.
- Plug and Play: Automatically install the driver once you hook up this RCA to USB Converter to a PC. No external power is needed. User-friendly and easy to operate
- Wide Compatibility: The Video Capture Card can work with video devices with RCA connector or S-Video connector, such as VHS, VCR, Hi8, camcorder, compatible with Windows and Mac OS. Support video formats like NTSC, PAL, and support brightness, contrast, hue, and saturation control
- Note: The Video Converter is used with acquisition software. We recommend OBS Studio or PotPlayer for Windows, and QuickTime Player for Mac. They can be downloaded for free online. Please operate according to the steps in User Manual or contact us if you have any questions
google-chrome --headless --screenshot=screenshot.png --window-size=1440,900 --timeout=10000 https://example.com
These examples produce PNG as documented. If the final format must be JPG, capture with Playwright or Puppeteer, or convert the PNG with an image utility after verifying that the conversion meets your quality requirements. A timeout is only a wait limit; it cannot guarantee that every script, font, or image has settled.
wkhtmltoimage for a local HTML file
The Debian manual documents HTML-to-image conversion and an --allow option for permitting local paths:
wkhtmltoimage --allow /path/to/assets /path/to/page.html page.jpg
Use the allowlisted directory for images, stylesheets, and other local resources. Because the manual is old, test modern layouts, web fonts, and client-side JavaScript before relying on this route in production.
Set JPG quality, dimensions, and background deliberately
Quality and file size
JPEG is lossy. Values around 80–90 are a practical starting point for web graphics; raise quality when text or fine UI lines show artifacts, and lower it when bandwidth or storage matters. The exact encoder behavior is tool-specific. Playwright documents a default quality of 80; Puppeteer documents a quality option.
Transparency
JPEG has no alpha channel. Playwright notes that omitBackground does not apply to JPEG, so transparent HTML backgrounds will be flattened rather than preserved. Choose PNG or WebP when transparency is a requirement.
Rank #4
- Convert your VHS tapes to DVD or digital to enhance and preserve your home movies
- Capture analog video directly from your camcorder or VCR and burn to DVD or convert to popular digital formats to share freely across devices
- Trim video, make quick edits, enhance color, add transitions, reduce noise and stabilize old footage to breathe new life into your old videos
- Complete your video experience by selecting from creative, customizable DVD menu templates, or creating personalized disc labels
- Get 2 DVDs for your first projects: An Amazon exclusive extra
Viewport versus full page
- Viewport: fixed dimensions that match what a visitor sees without scrolling.
- Full page: the entire scrollable document; useful for archives and long articles, but potentially very tall.
- Clip: a precisely bounded component or region.
Plan the output dimensions before capture. A narrow viewport can trigger a mobile breakpoint, while a wide viewport can change navigation, columns, and line wrapping.
Local files, authentication, and privacy
For protected pages, establish the session before the screenshot by supplying cookies or logging in within the automation script. Keep credentials out of source control and redact sensitive data in the rendered page. Local file references may be blocked unless the renderer is given access; wkhtmltoimage’s documented --allow option is one example of an explicit permission model.
Cross-origin images can fail to appear if the server denies requests or requires authentication. Check the browser console and network responses, and prefer serving related assets from a controlled origin when possible.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting common failures
The JPG is blank or only partly rendered
- Wait for a meaningful selector, not only the initial navigation event.
- Increase the navigation timeout for slow pages, then verify the selector is visible.
- Disable animations and scroll through lazy-loaded content when needed.
Fonts or images are missing
- Confirm the URLs are reachable from the capture environment.
- For local HTML, use correct absolute or
file://paths and grant local access. - Check for failed network requests, CORS restrictions, or authentication requirements.
The page is the wrong size
- Set the viewport before navigation.
- Use
fullPageonly when a tall document is intended. - Adjust device scale for pixel density rather than changing the CSS layout accidentally.
The output has unwanted popups or consent dialogs
Dismiss the dialog in automation, hide its selector before capture, or use a screenshot service that handles common overlays before rendering.
Chrome will not start in a server environment
Install the required browser dependencies, use headless mode, and review sandbox restrictions imposed by your container or hosting provider. Keep the browser process short-lived and close it in error-handling code.
Outdated 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 matchWindows 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 reinstallBest Value
- 2-in-1: vhs to digital converter & rca to hdmi converter! Digitize & Convert Simultaneously,Uniquely designed for both VHS to digital conversion and RCA to HDMI display output! Capture your old VHS tapes, VCRs, or PS2/Wii games to your computer via USB/Type-C port, while simultaneously viewing them in real-time on HDMI TVs/monitors. No need to buy separate devices—perfect for archiving family memories or retro gaming.
- USB-A & USB-C Dual Inputs for Universal Compatibility This VCR to digital converter Works with any computer! Connect via USB-A (for older PCs) or USB-C (for MacBook/Modern Laptops). Capture analog signals from VHS/DVD players, Hi8 cameras, or game consoles (PS2/Wii) and save them as MP4 files.
- Preserve Precious Memories in Digital Formats Rescue fading VHS tapes and convert them to digital files (1080p) for permanent storage or sharing. Compatible with a wide range of open capture software, supports batch conversion, clip editing, and direct upload to YouTube/Facebook. Ideal for weddings, birthdays, or vintage home videos.
- Usb video capture card for HDMI Live Preview & Multi-Device Support Watch your analog content on modern HDMI displays instantly! Convert RCA/AV signals to HDMI (Switch Function for 720p/1080p) for TVs, projectors, or gaming monitors. Bonus: Use the HDMI loop-through to preview digitization progress while capturing—no more guesswork!
- Retro Tech Revival: From VCRs to Wii Consoles Compatible with VHS/VCR/DVD players, Hi8 camcorders, PS2, Wii, and RCA-based devices. Includes RCA/AV cables and a USB-C adapter. Give your old gear new life—stream classic games, digitize tapes, or connect legacy devices to TVs effortlessly!
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server for developers. It accepts a URL and returns PNG, JPEG, WebP, or PDF. Before capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status.
One GET request is enough:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for output and option details. The same call in Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
And 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}`);
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
require('fs').writeFileSync('shot.webp', Buffer.from(await res.arrayBuffer()));
ScreenshotNeo also supports full-page capture with lazy images, CSS-selector element capture, dark mode, device presets or custom viewports, retina scale, PDF settings, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing gives two months free, and every feature is on every plan. Create a free ScreenshotNeo account to get started.
Automate repeated conversions safely
For a scheduled job, keep the browser version pinned, record the URL, viewport, wait condition, quality, and timestamp, and compare output dimensions or hashes to detect layout changes. Retry transient navigation failures with a limit, but do not hide persistent authentication or rendering errors. Cache unchanged pages when your use case permits, and avoid capturing private data into shared storage.
Frequently Asked Questions
Can I convert raw HTML text directly to JPG?
Yes. Set the HTML as page content in Playwright or Puppeteer, wait for its assets to load, and then call the JPEG screenshot method.
Is JPG better than PNG for a webpage screenshot?
JPG usually creates smaller files for photographic or general web imagery, but PNG preserves sharp text and transparency better. Choose based on the required fidelity and file size.
Why does a full-page JPG become extremely tall?
Full-page mode captures the document’s entire scrollable height. Use viewport mode or clip a specific element when a bounded image is required.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Does a screenshot timeout prove the page finished loading?
No. A timeout only limits how long the renderer waits. Use a selector, load-state check, or application-specific readiness signal as well.
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.




