plotly-print
Export Plotly figures to SVG, PNG, JPEG, or WebP without launching Chrome.
plotly-print runs a bundled Plotly.js 2D build in QuickJS, then uses resvg-py for raster output. It works offline, has no browser process to install or manage, and can replace Plotly's image-export methods with one call.
- Browser-free: no Chrome, Chromium, or Playwright.
- Fast: avoids browser startup; see the measured benchmarks.
- Familiar: use the direct API or patch Plotly's existing
to_imageandwrite_imagemethods.
Install | Direct API | Plotly integration | Benchmarks
Installation
pip install plotly-print
Requires Python 3.12 or newer.
Direct API
import plotly.express as px
import plotly_print
fig = px.scatter(x=[1, 2, 3, 4], y=[10, 11, 12, 13], title='Sales Growth')
svg = plotly_print.to_svg(fig)
png = plotly_print.to_image(fig, format='png', scale=2)
plotly_print.write_image(fig, 'chart.png')
to_image returns bytes. write_image writes to a path or binary file object. Supported formats are SVG, PNG, JPEG, and WebP.
Plotly integration
Patch Plotly's existing image-export methods:
import plotly_print
plotly_print.register()
After registration, existing calls such as fig.write_image("chart.png") use plotly-print. Call plotly_print.unregister() to restore Plotly's original methods.
plotly-print targets 2D static charts. The bundled Plotly.js build and its licenses are documented in THIRD_PARTY_NOTICES.md.
Benchmarks
On this run, plotly-print exported all 30 chart types 12x to 33x faster than Kaleido.
These are mean per-image PNG export times after both engines were warmed up. Timings are machine-specific; use the side-by-side images below to evaluate rendering differences.
See the raw results or run the benchmark locally.
| Category | Chart Type | Kaleido | plotly-print | Speedup |
|---|---|---|---|---|
| Core Cartesian | Scatter & Line Chart | 1668.5 ms | 88.2 ms | 18.9x |
| Core Cartesian | Grouped Bar Chart | 1758.1 ms | 81.3 ms | 21.6x |
| Core Cartesian | Donut / Pie Chart | 1628.6 ms | 73.6 ms | 22.1x |
| Core Cartesian | Box Plot | 1748.2 ms | 77.1 ms | 22.7x |
| Core Cartesian | Violin Plot | 1623.8 ms | 84.1 ms | 19.3x |
| Core Cartesian | Frequency Histogram | 1878.0 ms | 62.7 ms | 30.0x |
| Core Cartesian | 2D Density Histogram | 1949.4 ms | 98.8 ms | 19.7x |
| Core Cartesian | 2D Contour Plot | 1604.9 ms | 118.7 ms | 13.5x |
| Core Cartesian | Performance Heatmap | 1832.4 ms | 87.3 ms | 21.0x |
| Core Cartesian | Ternary Phase Diagram | 1724.9 ms | 84.9 ms | 20.3x |
| Financial & Business | Candlestick Stock Chart | 1741.1 ms | 140.5 ms | 12.4x |
| Financial & Business | OHLC Financial Chart | 1670.0 ms | 131.3 ms | 12.7x |
| Financial & Business | Waterfall Profit & Loss | 1793.0 ms | 64.7 ms | 27.7x |
| Financial & Business | Sales Conversion Funnel | 1629.9 ms | 91.1 ms | 17.9x |
| Financial & Business | Funnel Area Analysis | 1694.0 ms | 61.7 ms | 27.5x |
| Financial & Business | KPI Performance Indicator | 1634.1 ms | 57.2 ms | 28.6x |
| Hierarchical | Market Cap Treemap | 1625.4 ms | 52.6 ms | 30.9x |
| Hierarchical | Global Sunburst Hierarchy | 1723.9 ms | 61.8 ms | 27.9x |
| Hierarchical | Icicle Partition Chart | 1594.7 ms | 50.2 ms | 31.7x |
| Radial & Polar | Radar Performance Comparison | 2481.9 ms | 96.5 ms | 25.7x |
| Radial & Polar | Polar Wind Rose | 1826.6 ms | 77.5 ms | 23.6x |
| Specialized Diagrams | Energy Flow Sankey Diagram | 1708.4 ms | 51.7 ms | 33.1x |
| Specialized Diagrams | Parallel Categories Diagram | 1620.2 ms | 57.0 ms | 28.4x |
| Specialized Diagrams | Formatted Data Table | 1766.4 ms | 69.9 ms | 25.3x |
| Specialized Diagrams | Carpet Coordinate Plot | 1792.2 ms | 86.1 ms | 20.8x |
| Layout edge cases | Bar chart with X labels at 45 deg | 1673.2 ms | 89.0 ms | 18.8x |
| Layout edge cases | Bar chart with X labels at 90 deg | 1883.9 ms | 87.7 ms | 21.5x |
| Layout edge cases | Annotation arrowheads (incl. circle) | 1661.6 ms | 82.4 ms | 20.2x |
| Layout edge cases | Long annotation arrows (dasharray length) | 1719.1 ms | 79.7 ms | 21.6x |
| Layout edge cases | Table cells with HTML markup and entities | 1692.5 ms | 74.8 ms | 22.6x |
Visual comparisons
Side-by-side PNGs (Kaleido left, plotly-print right):
Core Cartesian
Scatter & Line Chart (plotly-print: 88.2ms | Kaleido: 1668.5ms)
Grouped Bar Chart (plotly-print: 81.3ms | Kaleido: 1758.1ms)
Donut / Pie Chart (plotly-print: 73.6ms | Kaleido: 1628.6ms)
Box Plot (plotly-print: 77.1ms | Kaleido: 1748.2ms)
Violin Plot (plotly-print: 84.1ms | Kaleido: 1623.8ms)
Frequency Histogram (plotly-print: 62.7ms | Kaleido: 1878.0ms)
2D Density Histogram (plotly-print: 98.8ms | Kaleido: 1949.4ms)
2D Contour Plot (plotly-print: 118.7ms | Kaleido: 1604.9ms)
Performance Heatmap (plotly-print: 87.3ms | Kaleido: 1832.4ms)
Ternary Phase Diagram (plotly-print: 84.9ms | Kaleido: 1724.9ms)
Financial & Business
Candlestick Stock Chart (plotly-print: 140.5ms | Kaleido: 1741.1ms)
OHLC Financial Chart (plotly-print: 131.3ms | Kaleido: 1670.0ms)
Waterfall Profit & Loss (plotly-print: 64.7ms | Kaleido: 1793.0ms)
Sales Conversion Funnel (plotly-print: 91.1ms | Kaleido: 1629.9ms)
Funnel Area Analysis (plotly-print: 61.7ms | Kaleido: 1694.0ms)
KPI Performance Indicator (plotly-print: 57.2ms | Kaleido: 1634.1ms)
Hierarchical
Market Cap Treemap (plotly-print: 52.6ms | Kaleido: 1625.4ms)
Global Sunburst Hierarchy (plotly-print: 61.8ms | Kaleido: 1723.9ms)
Icicle Partition Chart (plotly-print: 50.2ms | Kaleido: 1594.7ms)
Radial & Polar
Radar Performance Comparison (plotly-print: 96.5ms | Kaleido: 2481.9ms)
Polar Wind Rose (plotly-print: 77.5ms | Kaleido: 1826.6ms)
Specialized Diagrams
Energy Flow Sankey Diagram (plotly-print: 51.7ms | Kaleido: 1708.4ms)
Parallel Categories Diagram (plotly-print: 57.0ms | Kaleido: 1620.2ms)
Formatted Data Table (plotly-print: 69.9ms | Kaleido: 1766.4ms)
Carpet Coordinate Plot (plotly-print: 86.1ms | Kaleido: 1792.2ms)
Layout edge cases
Bar chart with X labels at 45 deg (plotly-print: 89.0ms | Kaleido: 1673.2ms)
Bar chart with X labels at 90 deg (plotly-print: 87.7ms | Kaleido: 1883.9ms)
Annotation arrowheads (incl. circle) (plotly-print: 82.4ms | Kaleido: 1661.6ms)
Long annotation arrows (dasharray length) (plotly-print: 79.7ms | Kaleido: 1719.1ms)
Table cells with HTML markup and entities (plotly-print: 74.8ms | Kaleido: 1692.5ms)
Attribution
plotly-print is an independent project derived from Mirage by Benjamin Lear (MIT). Bundled plotly.js is copyright Plotly, Inc. (MIT); see THIRD_PARTY_NOTICES.md.
Metadata
Release files for plotly-print 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| plotly_print-0.2.2.tar.gz | 2.1 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| plotly_print-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.8 MB
Release files / plotly_print-0.2.2.tar.gz
| Download URL | plotly_print-0.2.2.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fdde0140ddb8b6a246f17fa6303ff0106c009fb4c2f44ad182623db249b3932d
|
|
BLAKE2b-256 checksum How to use checksums |
9a6075d625ee99e3e6ae7502880ddf067dc706bbaf915f2fd80579213576dfc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / plotly_print-0.2.2-py3-none-any.whl
| Download URL | plotly_print-0.2.2-py3-none-any.whl |
|---|---|
| Size | 710.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f27449b40cc130e74c68ea7e37db16893c0ce144285e747275099399b8109886
|
|
BLAKE2b-256 checksum How to use checksums |
8474f6ef83fd0331036385a1e20f57c7aa4ea96c2a92544ee2975ea7505f6226
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for plotly-print 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.