# Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

# ReplacePixelValue

ReplacePixelValue[image,pposval]
changes the pixel values at pixel position ppos in image to val.

ReplacePixelValue[image,pposval,"type"]
assumes val to be of the specified type.

## DetailsDetails

• Pixel positions ppos 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 specification markerimage a marker image
• In ReplacePixelValue[image,{xp,yp}->val], the pixel position {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 y from 0 to height.
• In ReplacePixelValue, integer coordinates correspond to the centers of the pixels. In 2D, pixel position represents the center of the bottom-left pixel. In 3D, 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.
• ReplacePixelValue[image,{ppos1->val1,}] can be used to set pixel values for multiple positions.
• When the pixel position ppos lies on a boundary between pixels, all adjacent pixels are modified.
• ReplacePixelValue typically gives an image that has the same type as image.

## ExamplesExamplesopen allclose all

### Basic Examples  (3)Basic Examples  (3)

Set a pixel in an image:

 In[1]:=
 Out[1]=

Unset a pixel to separate connected components:

 In[1]:=
 Out[1]=

Set a pixel in the top-left front corner of a 3D image to gray:

 In[1]:=
 Out[1]=