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_r
ndarray
Image to map to red.
- image_g
ndarray
Image to map to green.
- image_b
ndarray
Image to map to blue.
- interval
BaseInterval
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.- stretch
BaseStretch
subclass instance, optional The stretch object to apply to the data. Default is
LinearStretch
.- filename
str
, optional Write the resulting RGB image to a file (file type determined from extension).
- output_dtype
numpy
scalar type, optional Image output data type. Default is np.uint8.
- image_r
- Returns:
- rgb
ndarray
RGB (either float or integer with 8-bits per channel) color image as an NxMx3 numpy array.
- rgb
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).