WLJS LogoWLJS Notebook

Rasterize

Wolfram Kernel
Rasterize[expression_, opts___]

rasterizes any expression into an Image using frontend as it is rendered in a cell.

Requires Desktop App for rasterizing (not available in server mode). It literally takes a screenshot of a specific area.

Blocking function. Avoid using it in timers like SetTimeout, external event handlers such as InputButton or Button, or within AsyncFunction. Use RasterizeAsync instead.

Options

"Notebook"

Optionally provide notebook object (generated by EvaluationNotebook) if you have used HTML, WLX, JS outputs in the provided expression.

"ExposureTime"

Sets the time in seconds for asynchronous frontend elements to finish rendering before capture. Increase it when labels, legends, insets, LaTeX, or other elements are missing from the rasterized result. The default is 1.

Rasterize[expression, "ExposureTime" -> 6]

Application

Can be used to export graphics to raster format try

Rasterize[x+y]

And then you can freely export it to an image file

Export["image.png", %]

On this page