gives the pixel value of image at position pos.


gives the pixel value converted to the specified type.

Details and Options

  • Pixel positions pos can be in one of the following forms:
  • {x,y} or {x,y,z}single position in 2D or 3D
    {xmin;;xmax,}span of positions
    {ppos1,ppos2,}a list of position specifications
    markerimagea marker image
  • ImageValue assumes the standard image coordinate system.
  • Use PixelValue to use integer indices for extracting exact pixel values of the image.
  • ImageValue[image,pos] by default returns values between 0 and 1. Using ImageValue[image,pos,"type"], a pixel value is returned in the range specified by "type". See the reference page for Image for a list of all possible data types.
  • ImageValue[image,pos,Automatic] is equivalent to ImageValue[image,pos,ImageType[image]].
  • The following options can be given:
  • DataRangeFullrange of image coordinates
    Padding0padding method to use
    Resampling"Linear"interpolation method to use
  • Possible settings for DataRange include:
  • Automatic{{0,1},{0,h/w}} in 2D, {{0,1},{0,d/w},{0,h/w}} in 3D
    Full{{0,w},{0,h}} in 2D, {{0,1},{0,d},{0,h}} in 3D (default)
    {{left,right},{bottom,top}}explicit coordinate ranges in 2D
    {{left,right},{front,back},{bottom,top}}explicit coordinate ranges in 3D
  • With Resampling->"Nearest", when the position pos lies on a boundary between pixels, the average of the pixels surrounding pos is returned. »


open all close all

Basic Examples  (3)

Value of a pixel in a color image:

Click for copyable input

Image value in "Byte" type:

Click for copyable input

Image value of a 3D volume:

Click for copyable input

Scope  (3)

Options  (3)

Applications  (1)

Possible Issues  (3)

Interactive Examples  (1)

Introduced in 2010
Updated in 2014