Write out a floating point array directly to a PNG file, scaling it and applying a colormap.
This function will scale an image and directly call libpng to write out a colormapped version of that image. It is designed for rapid-fire saving of image buffers generated using yt.raven.FixedResolutionBuffers and the like.
Parameters : | image : array_like
filename : string
color_bounds : tuple of floats, optional
cmap_name : string, optional
|
---|---|
Returns : | scaled_image : uint8 image that has been saved |
Examples
>>> proj = pf.h.slice(0, "Density")
>>> frb1 = FixedResolutionBuffer(proj, (0.2, 0.3, 0.4, 0.5),
(1024, 1024))
>>> write_image(frb1, "saved.png")