Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/StarTrail-org/PixelRAG/llms.txt

Use this file to discover all available pages before exploring further.

pixelshot converts any document — a live URL, a local PDF, or an HTML file — into a set of tiled JPEG images and a tiles.json manifest. These tiles are the input to every downstream PixelRAG stage: visual search indexing, agent browsing via the pixelbrowse skill, or your own image processing pipeline. It ships with pip install pixelrag and requires no extra setup on Linux x64; on Windows and macOS it auto-detects your system Chrome installation.

Rendering web pages

Point pixelshot at any URL and specify an output directory with --output (or -o):
pixelshot https://en.wikipedia.org/wiki/Python --output ./tiles
Each rendered document produces a tile subdirectory named after the URL stem, and a tiles.json manifest inside it:
./tiles/
└── Python.png.tiles/
    ├── tile_0000.jpg
    ├── tile_0001.jpg
    └── tiles.json
The manifest records the source URL, page height, and the list of tile filenames so downstream stages can reconstruct the full page layout without scanning the filesystem. Multiple URLs at once — pass them all on the command line:
pixelshot https://example.com https://example.org --output ./tiles
All URLs are rendered in parallel (controlled by --workers). Reading URLs from a .txt file — create a plain-text file with one URL per line and pass it as an argument:
pixelshot urls.txt --output ./tiles
Lines beginning with # are treated as comments and ignored.

Rendering PDFs

pixelshot renders PDFs page-by-page using PyMuPDF. Install the PDF extra first:
pip install 'pixelrag[pdf]'
Then pass a PDF path:
pixelshot paper.pdf --output ./tiles --dpi 200
Each page becomes one or more tiles in ./tiles/paper.png.tiles/. The default DPI of 200 produces roughly 1650 × 2200 pixels for an A4 page — high enough for the embedding model to read fine print while keeping file sizes reasonable.

Mixed inputs

URLs, PDFs, and local HTML files can be combined freely in a single command:
pixelshot https://example.com paper.pdf local.html --output ./tiles
pixelshot detects each input’s type from its prefix (http:///https://) or file extension (.pdf, .html, .htm) and routes it to the appropriate backend automatically.

Key flags

FlagDefaultDescription
--output / -o./tilesOutput directory for tile subdirectories
--tile-height8192Maximum tile height in pixels
--quality85JPEG compression quality (1–100)
--viewport-width875Browser viewport width in pixels
--workers4Number of parallel browser processes
--wait-network-idleoffWait until network goes idle before capturing — useful for JS-heavy SPAs that fetch content after the page load event
--backendcdpBrowser backend: cdp (default) or playwright
--cdp-urlAttach to an already-running Chrome DevTools endpoint instead of launching a throwaway browser
--dpi200Rendering resolution for PDFs
Environment variables:
VariableDescription
CHROME_PATHPath to a specific Chrome binary to use instead of the auto-detected one
PIXELSHOT_CDP_URLDefault CDP endpoint — equivalent to passing --cdp-url on every invocation

Python API

All three render functions are importable from pixelrag_render:
from pixelrag_render import render_url, render_urls, render_pdf

# Single URL
tiles = render_url("https://en.wikipedia.org/wiki/Python", "./tiles")

# Batch
tiles = render_urls(
    ["https://example.com", "https://example.org"],
    "./tiles",
    workers=4,
)

# PDF
tiles = render_pdf("paper.pdf", "./tiles", dpi=200)
render_url(url, output_dir, backend="cdp", *, tile_height=8192, quality=85, viewport_width=875, workers=1, **kwargs) Render a single URL to tiled JPEG images. Returns a list of Path objects pointing to the created tile directories. render_urls(urls, output_dir, backend="cdp", *, stems=None, tile_height=8192, quality=85, viewport_width=875, workers=4, **kwargs) Render a batch of URLs in parallel. The optional stems list lets you assign custom directory names (e.g. sequential integer IDs) instead of deriving them from the URLs. render_pdf(path, output_dir, *, dpi=200, pages=None, quality=85, stem=None) Render a PDF file. Pass a 1-based list of page numbers to pages to render a subset; None renders all pages.

Chrome backends

cdp (default)

The fastest option. Uses a bundled turbo headless_shell on Linux x64; on other platforms it auto-detects your system Chrome or Chromium installation. Each render runs in an isolated, throwaway profile — it works even while Chrome is already open.

playwright

Full-featured Chromium managed by Playwright. Needed for sites that require a Playwright-managed browser. Requires the additional extra:
pip install 'pixelrag[playwright]'
Chrome on Windows and macOS — the bundled turbo headless_shell auto-installs on Linux x64 only. On all other platforms, pixelshot looks for Chrome or Chromium in the standard system install locations and falls back to Playwright’s Chromium if neither is found.
Set CHROME_PATH=/path/to/chrome to point pixelshot at a specific binary if auto-detection fails. Set PIXELSHOT_CDP_URL=http://127.0.0.1:9222 to reuse a long-running Chrome process — useful in CI pipelines or when you need to capture pages behind an authenticated session.

Build docs developers (and LLMs) love