machinevisiontoolbox.Image.write

Image.write(filename, dtype='uint8', **kwargs)

Write image to file

Parameters:
  • filename (str) – filename to write to

  • dtype (str) – data type to convert to, before writing

  • kwargs – options for iwrite

Write image data to a file. The file format is taken from the extension of the filename.

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read('flowers1.png')
>>> img.write('flowers.jpg')
True
Seealso:

iwrite cv2.imwrite