# ImageValue

ImageValue[image,pos]

gives the pixel value of image at position pos.

ImageValue[image,pos,"type"]

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 {pos1,pos2,…} a list of position specifications markerimage a 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:
•  DataRange Full range of image coordinates Padding 0 padding 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. »

# Examples

open allclose all

## Basic Examples(3)

Value of a pixel in a color image:

 In[1]:=
 Out[1]=

Image value in "Byte" type:

 In[1]:=
 Out[1]=

Image value of a 3D volume:

 In[1]:=
 Out[1]=