ImageArray.
write_image
(filename, color_bounds=None, channel=None, cmap_name='algae', func=<function <lambda>>)[source]¶Writes a single channel of the ImageArray to a png file.
Parameters: | filename: string :
|
---|---|
Returns: | scaled_image : uint8 image that has been saved |
Other Parameters: | |
channel: int :
cmap_name: string :
color_bounds : tuple of floats, optional
cmap_name : string, optional
func : function, optional
|
Examples
>>> im = np.zeros([64,128])
>>> for i in range(im.shape[0]):
... im[i,:] = np.linspace(0.,0.3*i, im.shape[1])
>>> myinfo = {'field':'dinosaurs', 'east_vector':np.array([1.,0.,0.]),
... 'north_vector':np.array([0.,0.,1.]), 'normal_vector':np.array([0.,1.,0.]),
... 'width':0.245, 'units':'cm', 'type':'rendering'}
>>> im_arr = ImageArray(im, info=myinfo)
>>> im_arr.write_image('test_ImageArray.png')