Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many gray levels Matlab can show?

Let's say I have a Matrix Image of uint16.

Where basically each pixel can range from 0 to 65535.

If I display this image with imshow(Image) How many levels of gray Matlab will render?

The standard 255 levels (thus implicitly converting the image to uint8)?
(Please note I know I can change the colormap, but I would like to know only the number of gray levels )

like image 848
dynamic Avatar asked Feb 11 '13 13:02

dynamic


1 Answers

The size of the colormap tells you how many colors (or gray levels, in this case) Matlab is trying to display.

numGrayLevels = size(get(gcf,'Colormap'),1)

Note that most monitors only support 8-bits of gray. And depending on the quality and calibration of the display you may be seeing far less than that.

like image 163
shoelzer Avatar answered Sep 29 '22 01:09

shoelzer