pyvista.read_texture#
- read_texture(filename: str | Path, progress_bar: bool = False) Texture [source]#
Load a texture from an image file.
Will attempt to read any file type supported by
vtk
, however if it fails, it will attempt to useimageio
to read the file.- Parameters:
- Returns:
pyvista.Texture
PyVista texture object.
Examples
Read in an example jpg map file as a texture.
>>> from pathlib import Path >>> import pyvista as pv >>> from pyvista import examples >>> Path(examples.mapfile).name '2k_earth_daymap.jpg' >>> texture = pv.read_texture(examples.mapfile) >>> type(texture) <class 'pyvista.plotting.texture.Texture'>