Write out a bitmapped image directly to a PNG file.
This accepts a three- or four-channel bitmap_array. If the image is not already uint8, it will be scaled and converted. If it is not four channel, a fourth alpha channel will be added and set to fully opaque. The resultant image will be directly written to filename as a PNG with no colormap applied. max_val is a value used if the array is passed in as anything other than uint8; it will be the value used for scaling and clipping when the array is converted. Additionally, the minimum is assumed to be zero; this makes it primarily suited for the results of volume rendered images, rather than misaligned projections.
Parameters : | bitmap_array : array_like
filename : string
max_val : float, optional
|
---|