guiqwt.io¶
- The io module provides input/output helper functions:
guiqwt.io.imread()
: load an image (.png, .tiff, .dicom, etc.) and return its data as a NumPy arrayguiqwt.io.imwrite()
: save an array to an image fileguiqwt.io.load_items()
: load plot items from HDF5guiqwt.io.save_items()
: save plot items to HDF5
Reference¶
- guiqwt.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.
- guiqwt.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