Skip to main content

Capture a PNG screenshot of a local HTML presentation using Playwright

Project description

html-snapshot

Capture any HTML page as a PNG and (optionally) emit a structured layout report for automated checks.

Quick start (no install)

# one-time: ensure Playwright's Chromium runtime is available
uvx playwright install chromium

# generate a slide screenshot, plus an optional JSON layout report
uvx html-snapshot /path/to/slide.html \
    --output slide.png \
    --report slide.json

uvx runs the tool in an isolated environment downloaded from PyPI. The script auto-installs Chromium if it is missing (skip with --no-auto-install).

Install once, reuse often

Prefer a persistent CLI?

uv tool install html-snapshot   # adds `html-snapshot` to your PATH

html-snapshot /path/to/slide.html --output slide.png --report slide.json

Or use pip:

pip install html-snapshot
html-snapshot /path/to/slide.html --output slide.png

CLI options

Option Description
html_path Path to the local HTML file to render
-o / --output Output PNG path (default: input with .png suffix)
--report Optional JSON layout report (words, bounding boxes, warnings)
--width / --height Viewport size (default: 1400×900)
--delay Wait time after load before capture
--no-full-page Capture only the viewport
--no-auto-install Require Chromium to be pre-installed

Direct-from-GitHub fallback

If you’d rather run the latest commit without PyPI:

uvx --from git+https://github.com/oneryalcin/html-snapshot html-snapshot sample.html --output slide.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

html_snapshot-0.1.2.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

html_snapshot-0.1.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file html_snapshot-0.1.2.tar.gz.

File metadata

  • Download URL: html_snapshot-0.1.2.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for html_snapshot-0.1.2.tar.gz
Algorithm Hash digest
SHA256 38a693ee288de50607991995171fd8fdb59f05e04986857b5217acc968174f97
MD5 1bc87bdca16a3cb881a40511f7f5ca33
BLAKE2b-256 b886c1303f59ca16e6f8366342a9d30dc87e78249f06d668c12b0dd5b6cff54f

See more details on using hashes here.

File details

Details for the file html_snapshot-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for html_snapshot-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dcf98e4dbb003e57fbae67c84749f434d10b0152ca6354bc83f69a831f5b9f57
MD5 c6aa9b03f47bc48b0802d197251a107a
BLAKE2b-256 947702376a14ba108bd59b850f4d86aeb9535a63320b5d14a4e32ede8c11a63c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page