vispy.io.image module#

vispy.io.image.imread(filename, format=None)#

Read image data from disk

Requires imageio or PIL.

Parameters:
filenamestr

Filename to read.

formatstr | None

Format of the file. If None, it will be inferred from the filename.

Returns:
dataarray

Image data.

vispy.io.image.imsave(filename, im, format=None)#

Save image data to disk

Requires imageio or PIL.

Parameters:
filenamestr

Filename to write.

imarray

Image data.

formatstr | None

Format of the file. If None, it will be inferred from the filename.

vispy.io.image.read_png(filename)#

Read a PNG file to RGB8 or RGBA8 Requires Pillow.

Parameters:
filenamestr

File to read.

Returns:
dataarray

Image data.

See also

write_png, imread, imsave
vispy.io.image.write_png(filename, data)#

Write a PNG file

Unlike imsave, this requires no external dependencies.

Parameters:
filenamestr

File to save to.

dataarray

Image data.

See also

read_png, imread, imsave