Utilities related to data reading, writing, fetching, and generation.
Read image data from disk
Requires imageio or PIL.
Filename to read.
Format of the file. If None, it will be inferred from the filename.
Save image data to disk
Filename to write.
Load an image of a crate
256x256x3 crate image.
Get a standard vispy demo data file
The filename on the remote demo-data repository to download,
e.g. 'molecular_viewer/micelle.npy'. These correspond to paths
Directory to use to save the file. By default, the vispy
configuration directory is used.
If True, the file will be downloaded even if a local copy exists
(and this copy will be overwritten). Can also be a YYYY-MM-DD date
to ensure a file is up-to-date (modified date of a file on disk,
if present, is checked).
The path to the file on the local system.
Load the iris dataset
data[‘data’] : a (150, 4) NumPy array with the iris’ features
data[‘group’] : a (150,) NumPy array with the iris’ group
Load spatial-filters kernel
Whether or not the data should be in “packed” representation
for use in GLSL code.
16x1024x4 (packed float in rgba) or
16x1024 (unpacked float)
16 interpolation kernel with length 1024 each.
Respective interpolation names, plus “Nearest” which does
not require a filter but can still be used
Read mesh data from file.
File name to read. Format will be inferred from the filename.
Currently only ‘.obj’ and ‘.obj.gz’ are supported.
Triangle face definitions.
Normals for the mesh.
Read a PNG file to RGB8 or RGBA8
File to read.
Write mesh data to file.
Filename to write. Must end with “.obj” or “.gz”.
Name of the object.
Currently only “obj” is supported.
If the file exists, overwrite it.
Reshape the faces array to (Nf, 3). Set to False
if you need to write a mesh with non triangular faces.
Write a PNG file
Unlike imsave, this requires no external dependencies.
File to save to.