All Products
Search
Document Center

AnalyticDB:ST_ColorInterp

Last Updated:Mar 28, 2026

Returns the color interpretation of a specified band in a raster object.

Syntax

text ST_ColorInterp(raster raster_obj, integer band)

Parameters

ParameterDescription
raster_objThe raster object.
bandThe band index. Band indexes start from 0.

Return values

Returns a text value that identifies the color interpretation of the band. The following 18 values may be returned:

ValueDescription
UndefinedNo color interpretation is set for the band.
GrayIndexThe index of the associated gray value table.
RGBIndexThe index of the RGB color table.
RGBAIndexThe index of the RGBA color table.
RedBandThe red band in the RGB color model.
GreenBandThe green band in the RGB color model.
BlueBandThe blue band in the RGB color model.
AlphaBandThe alpha band in the RGBA color model.
HueBandThe hue band in the HSL color model.
SaturationBandThe saturation band in the HSL color model.
LightnessBandThe lightness band in the HSL color model.
CyanBandThe cyan band in the CMYK color model.
MagentaBandThe magenta band in the CMYK color model.
YellowBandThe yellow band in the CMYK color model.
BlackBandThe black band in the CMYK color model.
YCbCr_YBandThe Y band in the YCbCr color model.
YCbCr_CbBandThe Cb band in the YCbCr color model.
YCbCr_CrBandThe Cr band in the YCbCr color model.
When no color interpretation is configured for a band, ST_ColorInterp returns Undefined.

Example

Query the color interpretation of band 0 from a raster object:

SELECT ST_ColorInterp(raster_obj, 0) FROM raster_table WHERE id = 1;

Output:

 st_colorinterp
----------------
 RedBand