# PixelValuePositions

PixelValuePositions[image,val]

returns a list of pixel positions in image that match the value val.

PixelValuePositions[image,val,d]

returns all pixel positions that have values within a distance d from val.

# Details

• PixelValuePositions returns a list of integer positions {xp,yp} where {xp,yp}={x+1/2,y+1/2}, with {x,y} assumed to be in the standard image coordinate system where the values of x range from 0 to width, and the values of y range from 0 to height. Pixel position represents the center of the pixel at the bottom-left corner.
• In 3D, PixelValuePositions[image,val] returns the positions {xp,yp,zp}, such that pixel position corresponds to the center of the bottom-left front pixel.
• The pixel value val can be a scalar, a list of channel values, or a color.
• PixelValuePositions[image,val] is equivalent to PixelValuePositions[image,val,0].
• PixelValuePositions[image,"Min"] and PixelValuePositions[image,"Max"] can be used to return pixel positions with minimum and maximum intensity values, respectively.
• ImageValuePositions[image,val] is equivalent to PixelValuePositions[image,val]-0.5.

# Examples

open allclose all

## Basic Examples(3)

Extract positions of the white pixels:

 In[2]:=
 Out[2]=

Positions of the pixels with values within the specified distance from white:

 In[1]:=
 Out[1]=

Positions of white pixels in a 3D image:

 In[1]:=
 Out[1]=