Skip to main content
`Ctrl`+`K`

# vispy.io.image module

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

  Read image data from disk

  Requires imageio or PIL.

  Parameters:
    filename str

      Filename to read.

    format str | None

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

  Returns:
    data array

      Image data.

  See also

  `imsave`, `read_png`, `write_png`

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

  Save image data to disk

  Requires imageio or PIL.

  Parameters:
    filename str

      Filename to write.

    im array

      Image data.

    format str | None

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

  See also

  `imread`, `read_png`, `write_png`

vispy.io.image.read_png(filename)

  Read a PNG file to RGB8 or RGBA8 Requires Pillow.

  Parameters:
    filename str

      File to read.

  Returns:
    data array

      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:
    filename str

      File to save to.

    data array

      Image data.

  See also

  `read_png`, `imread`, `imsave`