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.
pixelrag_render exposes functions for rendering documents to tiled JPEG images from Python. Three functions — render_url, render_pdf, and render_file — are available as top-level imports from pixelrag_render. The batch variant render_urls is available from the inner module pixelrag_render.render. Under the hood they call browser-based (CDP) or PDF rendering backends and write a structured tile directory for each document, which the embedding and indexing stages then consume.
render_url
render_urls with a one-element list.
Parameters
URL to capture. Accepts
http://, https://, or file:// schemes.Directory to write the tile subdirectory into.
Rendering backend.
"cdp" (default, fastest) uses Chrome DevTools Protocol. "websocket" is accepted as a back-compat alias for "cdp". Any other value raises ValueError.Maximum height of each tile image in pixels. Tall pages are split into multiple tiles.
JPEG quality, 1–100.
Browser viewport width in pixels.
Number of parallel browser processes.
Additional keyword arguments forwarded to the backend. For example,
wait_network_idle=True waits for network quiet before capturing.Returns
list[Path] — tile directories created (one per rendered URL).
Example
render_urls
Parameters
URLs to capture.
Directory to write tile subdirectories into.
Rendering backend. Only
"cdp" is fully supported.Optional list of output directory stems, one per URL. When provided, tiles for
urls[i] are written to {output_dir}/{stems[i]}.png.tiles/ instead of deriving a name from the URL. Useful for assigning sequential numeric IDs (e.g. ["0", "1", "2", ...]), as the pixelrag index build pipeline does.Maximum tile height in pixels.
JPEG quality, 1–100.
Browser viewport width in pixels.
Number of parallel browser processes.
Additional keyword arguments forwarded to the backend.
Returns
list[Path] — tile directories created (one per URL).
Example
render_pdf
Parameters
Path to the PDF file on disk.
Directory to write the tile subdirectory into.
Rendering resolution. At 200 DPI, A4 pages render at approximately 1650×2200 px.
1-based list of page numbers to render.
None renders all pages.JPEG quality, 1–100.
Override the tile directory name (default: PDF filename stem, e.g.
"report" for report.pdf).Returns
list[Path] — a list containing the tile directory path.
Example
Output Structure
Every rendering function writes a{stem}.png.tiles/ subdirectory under output_dir:
tiles.json manifest records the article ID, page height, viewport width, tile height, and tile filenames. The chunking stage (pixelrag chunk) reads this manifest to produce the 1024 px chunk files and chunks.json that the embedding stage consumes.