plotpy.io¶
- The io module provides input/output helper functions:
plotpy.io.imread()
: load an image (.png, .tiff, .dicom, etc.) and return its data as a NumPy arrayplotpy.io.imwrite()
: save an array to an image fileplotpy.io.load_items()
: load plot items from HDF5plotpy.io.save_items()
: save plot items to HDF5
Reference¶
-
plotpy.io.
imread
(fname, ext=None, to_grayscale=False)[source]¶ Return a NumPy array from an image filename fname.
If to_grayscale is True, convert RGB images to grayscale The ext (optional) argument is a string that specifies the file extension which defines the input format: when not specified, the input format is guessed from filename.
-
plotpy.io.
imwrite
(fname, arr, ext=None, dtype=None, max_range=None, **kwargs)[source]¶ Save a NumPy array to an image filename fname.
If to_grayscale is True, convert RGB images to grayscale The ext (optional) argument is a string that specifies the file extension which defines the input format: when not specified, the input format is guessed from filename. If max_range is True, array data is scaled to fit the dtype (or data type itself if dtype is None) dynamic range Warning: option max_range changes data in place