make_rgb#

astropy.visualization.make_rgb(image_r, image_g, image_b, interval=<astropy.visualization.interval.ManualInterval object>, stretch=<astropy.visualization.stretch.LinearStretch object>, filename=None, output_dtype=<class 'numpy.uint8'>)[source]#

Base class to return a Red/Green/Blue color image from 3 images using a specified stretch and interval, for each band independently.

The input images can be int or float, and in any range or bit-depth, but must have the same shape (NxM).

For a more detailed look at the use of this method, see the document Creating color RGB images.

Parameters:
image_rndarray

Image to map to red.

image_gndarray

Image to map to green.

image_bndarray

Image to map to blue.

intervalBaseInterval subclass instance or array_like, optional

The interval object to apply to the data (either a single instance or an array for R, G, B). Default is ManualInterval with vmin=0.

stretchBaseStretch subclass instance, optional

The stretch object to apply to the data. Default is LinearStretch.

filenamestr, optional

Write the resulting RGB image to a file (file type determined from extension).

output_dtypenumpy scalar type, optional

Image output data type. Default is np.uint8.

Returns:
rgbndarray

RGB (either float or integer with 8-bits per channel) color image as an NxMx3 numpy array.

Notes

This procedure of clipping and then scaling is similar to the DS9 image algorithm (see the DS9 reference guide: http://ds9.si.edu/doc/ref/how.html).