Function File: range = getrangefromclass (img)

Return display range of image.

For a given image img, returns the 1x2 element matrix range with the display range (minimum and maximum display values) for an image of that class.

Images of different classes have different display ranges, the ranges of values that Octave will interpret between black to white. For an integer image, the range is from intmin to intmax of that class; for images of class logical, single, or double, the range is [0 1].

Note that range will be of class double, independently of the class of img.

getrangefromclass (ones (5)) # note that class is 'double'
     ⇒ [0   1]
getrangefromclass (logical (ones (5)))
     ⇒ [0   1]
getrangefromclass (int8 (ones (5)))
     ⇒ [-128  127]

See also: intmin, intmax, bitmax.

Package: image