Plotter.image

Plotter.image#

property Plotter.image: NDArray[np.uint8][source]#

Return an image array of current render window.

The image has an alpha channel when the plotter has a transparent background, which is set by the theme and by screenshot(). With the 'straight' and 'premultiplied' options, reading the image renders the scene again over a black background; see screenshot().

Added in version 0.50: Support for the 'straight' and 'premultiplied' transparent backgrounds.

Changed in version 0.50: A RuntimeError is raised instead of an AttributeError when the plotter has not been rendered.

Returns:
numpy.ndarray

Image array of current render window.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> pl = pv.Plotter(off_screen=True)
>>> _ = pl.add_mesh(pv.Cube())
>>> pl.show()
../../../_images/pyvista-Plotter-image-fadd972370937e73_00_00.png