This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

ImageLevels

ImageLevels[image]
gives a list of pixel values and counts for each channel in image.
ImageLevels[image, n]
bins pixel values into n equally spaced levels.
ImageLevels[image, n, {min, max}]
puts all values into n bins between min and max.
  • ImageLevels gives a list of results for each channel. The result for each channel is a list of pairs, each giving the minimum value and count for a particular pixel value bin.
  • ImageLevels[image, n] by default takes the first bin to start at 0 and the last one to end at 1. Channel values below 0 or above 1 are placed in the first and last bins respectively.
  • ImageLevels[image, n, {min, max}] takes the first bin to start at min, and the last bin to end at max.
  • ImageLevels[image, n, All] gives n equally spaced bins, extending over the complete range of values in each channel.
  • In ImageLevels[image, n, {min, max}], either min or max individually can be All.
Count the number of pixels in each of 10 intensity levels:
Levels of a three-channel image:
Levels for a random image that has intensity values outside the normal range from 0 to 1:
Explicit data range setting:
Count the number of pixels in each of 10 intensity levels:
In[1]:=
Click for copyable input
Out[1]=
 
Levels of a three-channel image:
In[1]:=
Click for copyable input
Out[1]=
 
Levels for a random image that has intensity values outside the normal range from 0 to 1:
In[1]:=
Click for copyable input
Out[1]=
 
Explicit data range setting:
In[1]:=
Click for copyable input
Out[1]=
New in 7