Prepare a PNG snapshot
Build the portable Graphics value used by the host PNG rasterizer.
Inspect the browser contract
PNG lowers the retained Graphic to SVG and then asks its host for a rasterizer. The browser can load and inspect this contract, but it does not pretend to spawn rsvg-convert or ImageMagick. Calling .png.Render here therefore reports png-rasterizer-unavailable.
Use .png.Render(scene, {= scale=2, dpi=144, background="white" }) in a capable host, or .Out("diagram.png", scene) with the CLI.
- Browser: contract discovery and portable input preview only.
- CLI: requires
rsvg-convertor ImageMagick'smagick. - Size options:
scale,dpi,width, andheight. - Color options:
background,colorProfile="srgb"|"native"|"none", and
antialiasing="on"|"off".
- Asset options: a scalar
metadatamap,region=[x,y,width,height], and a
document figure index or label.
Prepare a reproducible asset policy
This cell is browser-safe because it constructs and displays the policy rather than attempting host process execution:
At 300 DPI with the default scale, that 100-by-80 logical region becomes 313-by-250 pixels after outward-independent nearest integer sizing. Supplying only width or only height preserves the crop's aspect ratio.
Select a Figure from a document
A capable host can rasterize either Figure without flattening the whole document. The PNG result retains the selected label, caption, alternative text, source dimensions, and normalized byte policy.
The repository's polynomial-transparency.rix fixture overlays a half-opacity annotation on a quadratic curve. Host tests render that same SVG through librsvg and ImageMagick and compare the visible result with a tolerant metric, so toolchain upgrades need not preserve incidental PNG bytes.