magpack.io.save_image#

save_image(img, filename, cmap='viridis', vmin=None, vmax=None, alpha=False, alpha_thresh=750, indexing='ij')#

Saves a numpy array as a full resolution png file.

Parameters:
imgnp.ndarray

Image to save.

filenamestr

Name of output file.

cmapstr (optional)

Matplotlib colormap name.

vminfloat (optional)

Lower bound for colorbar axis (defaults to minimum value in the img array).

vmaxfloat (optional)

Upper bound for colorbar axis (defaults to maximum value in the img array).

alphabool (optional)

Option to make bright pixels (white) transparent.

alpha_threshint (optional)

Threshold value for transparency, maximum value is \(765 (=255\times3)\).

indexing{‘ij’, ‘xy’} (optional)

Indexing scheme (xy for matplotlib convention, default is ij).