Graphics Previous page   Next Page

8-Bit and 16-Bit RGB Images

The color components of an 8-bit RGB image are integers in the range [0, 255] rather than floating-point values in the range [0, 1]. A pixel whose color components are (255,255,255) is displayed as white. The image command displays an RGB image correctly whether its class is double, uint8, or unit16.

To convert an RGB image from double to uint8, first multiply by 255.

Conversely, divide by 255 after converting a uint8 RGB image to double.

To convert an RGB image from double to uint16, first multiply by 65535.

Conversely, divide by 65535 after converting a uint16 RGB image to double.


Previous page  8-Bit and 16-Bit Intensity Images Mathematical Operations Support for uint8 and uint16 Next page

© 1994-2005 The MathWorks, Inc.