ImageValue

ImageValue[image, {x, y}]
gives the pixel value of image at position .

ImageValue[image, {xmin;;xmax, ymin;;ymax}]
gives the values of pixels whose coordinates range from to .

ImageValue[image, {x, y}, "type"]
gives the pixel value converted to the specified type.

Details and OptionsDetails and Options

  • ImageValue assumes the standard image coordinate system, where x runs from to width and y runs from to height. Position corresponds to the bottom-left corner of the image.
  • Use PixelValue to use integer indices for extracting exact pixel values of the image.
  • ImageValue[image, {{x1, y1}, ...}] can be used to get pixel values for multiple positions.
  • ImageValue[image, {x, y}] by default returns values between 0 and 1. Using ImageValue[image, {x, y}, "type"], a pixel value is returned in the range specified by . See the reference page for Image for a list of all possible data types.
  • ImageValue[image, {x, y}, Automatic] is equivalent to ImageValue[image, {x, y}, ImageType[image]].
  • Possible settings for DataRange:
  • Automatic
    Full
    {{xmin,xmax},{ymin,ymax}}values in the specified intervals for x and y
  • In 3D, ImageValue[image, {x, y, z}] assumes the standard 3D coordinate system, where x runs from to width, y runs from to depth, and z runs from 0 to height. The position corresponds to the bottom-left front corner.
  • ImageValue supports a Resampling option to specify the interpolation method. The default setting is Resampling->"Bilinear".
  • With Resampling->"Nearest", when the position lies on a boundary between pixels, the average of the pixels surrounding is returned. »
  • ImageValue can take a Padding option, which is used when a specified position is beyond an image.
New in 8 | Last modified in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »