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

HTML becomes a JPG by rendering it in a browser and capturing the resulting pixels. SVG becomes a JPG by rasterizing it at a chosen size, then encoding that raster as JPEG. Use Playwright when CSS, web fonts, images, and JavaScript must look as they do in a browser. Use Inkscape plus ImageMagick when the input is a standalone SVG and you need explicit pixel dimensions. JPG does not support transparency; keep PNG when transparent pixels matter.

Choose the right conversion route

Input Best route What you control Important limitation
Live webpage URL Playwright browser screenshot Viewport, full page, element, device scale, JPEG quality Output reflects the page state reached by the browser
Local HTML file or HTML string Playwright, or a wrapper such as Browsershot Browser CSS, fonts, JavaScript, waits and capture area Requires a compatible browser runtime; verify wrapper options for your installed version
Standalone SVG Inkscape raster export, then ImageMagick JPEG conversion Output width, height and JPEG encoding Raster output cannot regain vector sharpness when enlarged

Decide the capture area before writing code. A viewport image contains only the visible screen, a full-page image contains the document’s scrollable content, and an element image isolates a selected component. Playwright documents all three modes in its Page API; its description of a full-page image is a screenshot “of the full scrollable page, as if it were a very tall screen.”

Convert a webpage or HTML file to JPG with Playwright

Playwright launches a real browser engine, so layout, CSS, web fonts, images and JavaScript are rendered before the pixels are saved. Install the package and a browser once:

pip install playwright
playwright install chromium

Save this as html_to_jpg.py for a URL:

from pathlib import Path
from playwright.sync_api import sync_playwright

URL = "https://example.com"

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True)
    page = browser.new_page(
        viewport={"width": 1440, "height": 900},
        device_scale_factor=1,
    )
    page.goto(URL, wait_until="networkidle", timeout=90_000)
    page.screenshot(
        path="page.jpg",
        type="jpeg",
        quality=85,
        full_page=True,
    )
    browser.close()

The documented JPEG quality range is 0–100 and the default is 80. A value such as 85 is a practical starting point; raise it when small text or gradients show compression artifacts, and lower it when file size is more important. Quality is not a guarantee of visual fidelity, so inspect the actual output.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Nelko PP01 Photo Printer, 2x3 Portable Photo Printer, Mini Printer, White
  • 2x3" Portable Photo Printer: The upgraded PP01 photo printer uses advanced inkjet technology. This portable photo printer produces vivid, full-color prints on premium sticky-backed photo paper that is smudge-proof, water-resistant, and tear-resistant. The Nelko mini photo printer is pocket-sized and weighs only 308g, making it ultra-portable for school, travel, and field trips. Each ink cartridge prints up to 80 full-color 2x3 photos on sticky-backed paper
  • Easy Printing via Bluetooth: The PP01 mini photo printer is compatible with iOS and Android phones via Bluetooth. Simply download the Nelko app from Google Play or the App Store. Load the 2x3 photo paper with the smooth side facing down. Install the ink cartridge, connect via Bluetooth, and print directly using the Nelko app. A USB charging cable is included; the adapter is not included
  • High Photo Quality: This mini photo printer uses advanced inkjet technology for clear, vibrant prints. This portable photo printer produces 600 DPI high-resolution images with precise colors, capturing fine details and realistic tones. Each photo comes with adhesive backing, perfect for scrapbooks and preserving your memories. Personalize every photo for holidays, birthdays, or daily events
  • Powerful App: The Nelko 2x3" PP01 photo printer app lets you edit photos and offers a variety of frame designs, making it perfect for personalizing your photos for projects like scrapbooking or journaling. Download the Nelko app to create collages and customize photos with filters, graffiti, borders, stickers, text, AI image editing, and many other features. Edit photos on your phone, then send them to the Nelko app for instant printing in under 90 seconds
  • Versatile Usage Scenarios: This portable photo printer is ideal for travel journals, party favors, and family gatherings. Students use it for planners and photo printing. Crafters use it for DIY projects, custom labels, and scrapbooking. It's a practical tool for bloggers, small businesses, and event photographers to create instant giveaways. Perfect for Mother's Day surprises and heartfelt moments with loved ones using Nelko sticky-backed photo paper.

Capture only the visible viewport

Remove full_page=True (or set it to False) to save the current viewport. Set the viewport before navigation because responsive breakpoints can change wrapping, menus and component dimensions.

page.screenshot(
    path="viewport.jpg",
    type="jpeg",
    quality=85,
)

Capture one element

Locate a component with a CSS selector and screenshot its bounding box:

card = page.locator(".pricing-card").first
card.screenshot(path="card.jpg", type="jpeg", quality=90)

If the selector is generated dynamically, wait for it first:

page.locator(".pricing-card").first.wait_for(state="visible", timeout=30_000)

Use device-pixel scaling for sharper output

device_scale_factor=1 writes one output pixel per CSS pixel. A value of 2 produces a larger, denser image for the same CSS layout, which can improve readability in documents that will be displayed or printed at high density. It also increases memory use and file size. Choose the scale before navigation:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
page = browser.new_page(
    viewport={"width": 1280, "height": 800},
    device_scale_factor=2,
)

Do not confuse a larger device scale with a different responsive layout: the viewport width and height determine CSS breakpoints, while the device scale determines pixel density.

Rank #2
Sale
Liene M100 4x6'' Photo Printer, Phone Printer 100 Sheets & 3 Cartridges, Full-Color Photo, Portable Instant Photo Printer for iPhone Android, Thermal Dye Sublimation, Wi-Fi Picture Printer 100 Papers
  • User-Friendly Portable Photo Printer for iPhone, Android & PC - Get beautiful and colourful memories with Liene 4x6 photo printer! After opening the entire package, you can find one cartridge + 20 sheets of photo paper (placed inside the machine packaging), as well as an additional box containing 80 sheets of photo paper (which includes two cartridges + 80 sheets of photo paper). Full package includes smartphone photo printer, Liene 4x6 photo printer papers (100 sheets), 3 colour cartridges, and fully sealed cassette to prevent dust. Minimalist and magnetic design for compact storage.
  • Superior Quality 4x6 Photo Printer - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Clean the print head promptly if smudges are observed on printed photos during operation. Get Liene photo printers now for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Wi-Fi Photo Printer for Smartphone - The built-in hotspot of the photo printer makes it easy to print pictures from your phone, avoiding outside interference with a fast and stable connection. No other networks required! Simply connect your device to the independent instant photo printer 4x6 hotspot.
  • Multiple Device Compatibility - Liene phone printer provides instant photo printing for up to 5 simultaneous connections. Share with family and friends or print from your different devices. No additional cables or Bluetooth required when printing photos with this picture printer. Note: Ensure the ink cartridge clicks into place before printing.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Square border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this photo printer for iphone 4x6 prints.

Make local HTML or an HTML string

For a local file, convert its absolute path to a file: URL:

from pathlib import Path
from playwright.sync_api import sync_playwright

html_file = Path("report.html").resolve()
with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page(viewport={"width": 1200, "height": 800})
    page.goto(html_file.as_uri(), wait_until="networkidle")
    page.screenshot(path="report.jpg", type="jpeg", quality=88, full_page=True)
    browser.close()

For a raw string, use page.set_content(). External resources must be reachable from the process, and relative URLs need a meaningful base URL or absolute paths:

html = """<!doctype html>
<html><body><h1>Invoice</h1></body></html>"""
with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page(viewport={"width": 1000, "height": 700})
    page.set_content(html, wait_until="networkidle")
    page.screenshot(path="invoice.jpg", type="jpeg", quality=90)
    browser.close()

If your application already uses PHP, Spatie Browsershot provides URL and HTML rendering through Puppeteer and headless Chrome. Its project documentation should be checked against the installed release before relying on exact method names or supported screenshot formats.

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

Convert SVG to JPG with Inkscape and ImageMagick

SVG is vector data, so first render it to a raster image at the dimensions you need. Then encode that raster as JPEG. Inkscape documents command-line export, and ImageMagick documents format conversion by file extension.

  1. Install Inkscape and ImageMagick for your operating system.
  2. Export the SVG to a PNG at the target width and height.
  3. Convert the PNG to JPG and choose JPEG quality.
  4. Open the JPG and verify text, gradients, clipping and dimensions.

A typical shell pipeline is:

inkscape artwork.svg --export-type=png --export-filename=artwork.png --export-width=1600
magick artwork.png -quality 90 artwork.jpg

Use --export-height instead when height is the controlling dimension. If both width and height are specified, preserve the intended aspect ratio yourself; forcing incompatible dimensions distorts the artwork. Inkscape command-line syntax can vary by installed release, so confirm the flags in the current command-line documentation. ImageMagick’s extension-based workflow is described in its conversion documentation.

Rank #3
KODAK Dock Plus 4x6 Photo Printer, Smartphone Docking, 4PASS, 50 Sheets
  • Dock Photo Printer: The KODAK Dock Plus is a home photo printer that produces high-quality 4x6” prints directly from compatible smartphones. Featuring an integrated docking station, users can place their phone on the printer for better connection while simultaneously charging the device during printing.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Dock Plus is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Home Printing Station: Designed for stable desktop use, this dock photo printer connects to a power outlet for consistent performance and larger 4x6” prints. Ideal for home printing, photo albums, framing, family events, and everyday picture printing.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.

Backgrounds and transparency

JPEG has no alpha channel. Transparent SVG pixels therefore need a background color during rasterization or conversion. If the artwork must remain transparent, stop at PNG (or another alpha-supporting format) instead of producing JPG. Playwright likewise states that its omit-background option does not apply to JPEG.

Settings that determine the result

Viewport and responsive layout

Changing width or height can activate mobile navigation, alter line breaks and change the final image dimensions. Record the viewport used for reproducible output, and use a fixed viewport in automated jobs.

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

Waiting for complete content

wait_until="networkidle" waits for network activity to settle, but pages with analytics, advertisements or live updates may never become truly idle. In those cases, wait for a meaningful selector or use a bounded delay:

page.goto(URL, wait_until="domcontentloaded", timeout=90_000)
page.locator("main article").wait_for(state="visible", timeout=30_000)
page.wait_for_timeout(1_000)

Waiting for a selector is usually more reliable than guessing a long delay, while a timeout prevents a broken page from hanging the job indefinitely.

Fonts and external images

A missing web font changes line wrapping and can shift every element below it. Ensure the browser can reach the font host, or install and load the font locally. A blocked image may leave an empty region; check request errors and page content before accepting the file.

Rank #4
KODAK Mini 2 Retro 2x3 Portable Photo Printer, 4PASS, 38 Sheets, White
  • Instant Photo Printing: The KODAK Mini 2 Retro is a portable photo printer designed to turn smartphone pictures into high quality prints in seconds. Whether capturing family moments, travel highlights, journaling pages, or creative projects, this mini printer lets you print real photos anytime, anywhere.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Mini 2 Retro is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Print Anytime, Anywhere: Small enough to fit in your hand, bag, or even a pocket, the Mini 2 Retro is built for on-the-go printing. Ideal for parties, trips, school projects, scrapbooks, and spontaneous moments where you want real prints without waiting.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.

JPEG quality and dimensions

Higher quality generally means less compression loss and a larger file. Choose dimensions first, then quality. Enlarging a small JPG cannot restore detail that was never rendered; for SVG, rasterize at the largest final size you actually need.

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

Automation patterns and operational safeguards

  • Batch jobs: reuse one browser process and create a new page or context per URL; this avoids launching Chromium for every image.
  • Isolation: use separate contexts when cookies, locale or authentication must not leak between captures.
  • Retries: retry transient navigation failures with a limit and backoff, but do not endlessly retry a persistent 404 or access block.
  • Reproducibility: pin the Playwright package and browser version used by your deployment, and record viewport, device scale, URL and quality beside each output.
  • Security: treat untrusted HTML and URLs as untrusted input. Restrict network access and avoid exposing credentials through page content or debug logs.

Common failures and fixes

Symptom Likely cause Fix
Executable doesn't exist Chromium was not installed for Playwright. Run playwright install chromium in the same environment as the script.
Blank or half-rendered image Capture occurred before content or fonts loaded. Wait for a meaningful selector, then capture; verify resource requests and use a bounded timeout.
Mobile layout appears unexpectedly Viewport is narrower than the desktop breakpoint. Set the intended viewport before goto().
Full page is clipped The page uses nested scroll containers or content loads after measurement. Wait for content, inspect the scroll container, and capture that element separately when appropriate.
SVG looks stretched Width and height do not match the artwork’s aspect ratio. Set one dimension or calculate a proportional pair before exporting.
Transparent areas became black or white JPEG cannot store transparency. Choose a deliberate background or retain PNG.
Text is blurry Output was rasterized too small or heavily compressed. Increase SVG export dimensions or device scale, then raise JPEG quality.
Navigation times out Slow resources, a blocked host or a page that continually polls. Check connectivity, use a selector-based wait, set a finite timeout and handle the failure rather than saving a partial image.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request renders a URL and returns PNG, JPEG, WebP or PDF. It accepts the cookie or consent banner like a visitor, then removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and whether it was billed.

Use the API with the same URL parameters many screenshot services use. The following cURL command writes a WebP file; request JPEG by adding the relevant output parameter documented at ScreenshotNeo’s 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}`);

For HTML-to-image work, relevant options include full-page or CSS-selector capture, dark mode, 12 device presets or a custom viewport, retina scale, custom CSS and JavaScript, click-before-capture, hide selectors, waits for a selector, delay or network idle, request and resource blocking, custom headers, cookies, user agent, authorization, timezone and geolocation, transparent backgrounds, resizing, a chosen cache TTL, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. It also offers PDF settings and HTML/CSS-to-image input.

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; Growth is $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000 and Business $249 for 1,000,000. Yearly billing gives two months free, and every feature is on every plan. Its MCP server exposes take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients, so an AI agent can request captures without you wiring a browser runtime.

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

Create a free ScreenshotNeo account to start with 1,000 screenshots a month and no card.

Best Value
KODAK Step Instant Smartphone Photo Printer, Portable Mini Color Wireless Mobile Printer, Zink 2x3” (5.1x7.5 cm) Sticky-Back Photos, Bluetooth Compatible with iOS & Android Devices, Editing App, White
  • STEP UP YOUR PRINTING GAME. KODAK Step Printer Connects to Any iOS or Android Device [Via Bluetooth or NFC] Turn Your Selfies, Portraits, Social Media Posts Into Physical Photos.Package Includes : KODAK STEP Instant Mobile Photo Printer, Micro USB Charging Cable, Starter Pack of KODAK ZINK Photo Paper, Quick Start Guide, Limited Warranty
  • AMAZING ZERO-INK TECHNOLOGY. ZINK 2” x 3” Sticky-Back Paper with Embedded Dye Crystals Delivers High-Quality, Durable, Affordable, Beautifully Detailed Prints That are Resistant to Moisture, Rips, Tears & Smudges.
  • FULL EDITING SUITE VIA APP. Download the KODAK App to Create Collages & Customize Your Snaps with Stunning Filters, Interesting Borders, Cool Stickers, Funny Text & Other Personalized Flair.
  • TAKE YOUR PROJECTS TO GO. Our Palm-Sized Printer Weighs Less Than a Pound, Sets Up Fast & Delivers Gorgeous Prints You Can Peel & Stick Everywhere.
  • CUTE, COMPACT & COLORFUL. Step Printer is Designed for Photo-Loving Influencers & Crafters of All Ages & Skill Levels! Portable, Lightweight Device Features Built-In Lithium-Ion Rechargeable Battery [Prints 25 Photo on a Full Charge]

FAQ

Can I rename an HTML file to .jpg?

No. HTML contains structure and instructions; it must be rendered to pixels first.

Is SVG-to-JPG conversion lossless?

No. SVG rendering can be lossless at its chosen raster dimensions, but JPEG encoding is lossy and cannot preserve vector scalability.

Which format should I use for a transparent logo?

Use PNG or another format with an alpha channel. JPG always requires an opaque background.

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.

Why does my screenshot differ between machines?

Browser version, installed fonts, viewport, device scale, network responses and page timing can all change rendered pixels. Pin the runtime and make those settings explicit.

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.