Or say does 1
denotes white for an RGB image?
I have this question because of this answer:
Can someone clarify it?
Or say does 1
denotes white for an RGB image?
I have this question because of this answer:
Can someone clarify it?
Image data in MATLAB can be stored as different data types. The type of image as well as the data type it is stored as will determine what constitutes the color "white":
A grayscale image matrix (which has one data value per pixel) can be any one of the following data types: uint8
, uint16
, int16
, single
, or double
. From the documentation:
For a matrix of class
single
ordouble
, using the default grayscale colormap, the intensity 0 represents black and the intensity 1 represents white. For a matrix of typeuint8
,uint16
, orint16
, the intensityintmin(class(I))
represents black and the intensityintmax(class(I))
represents white.
An RGB image matrix (which has three data values per pixel: red, green, and blue) can be any one of the following data types: uint8
, uint16
, single
, or double
. From the documentation:
In a truecolor array of class
single
ordouble
, each color component is a value between 0 and 1. A pixel whose color components are (0,0,0) is displayed as black, and a pixel whose color components are (1,1,1) is displayed as white.