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.


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.
Details


- ReplacePixelValue is typically used for image correction or annotation of 2D and 3D images by replacing pixel values at selected positions.
- ReplacePixelValue assumes a pixel-aligned coordinate system that is shifted by 0.5 to the left and down with respect to the standard image coordinate system.
- 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.
- 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 {xmin;;xmax;;xstep,…} span of positions with steps {pos1,pos2,…} a list of position specifications markerimage a marker image - 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.
- Pixel value val can be in one of the following forms:
-
s a scalar color a color {s1,s2,…} a list of channel values - Possible settings for "type" include:
-
"Bit" integer 0 or 1 "Byte" integer 0 through 255 "Bit16" integer 0 through 65535 "Real32" single-precision real (32 bit) "Real64" double-precision real (64 bit) - ReplacePixelValue typically gives an image that has the same type as image.

Examples
open all close allBasic Examples (3)
Scope (12)
Data (4)
Position (6)
Replace pixel values at multiple positions:
Replace multiple pixel values:
Use Span to replace multiple pixel values:
Applications (2)
Related Guides
Text
Wolfram Research (2012), ReplacePixelValue, Wolfram Language function, https://reference.wolfram.com/language/ref/ReplacePixelValue.html (updated 2014).
CMS
Wolfram Language. 2012. "ReplacePixelValue." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/ReplacePixelValue.html.
APA
Wolfram Language. (2012). ReplacePixelValue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ReplacePixelValue.html
BibTeX
@misc{reference.wolfram_2025_replacepixelvalue, author="Wolfram Research", title="{ReplacePixelValue}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/ReplacePixelValue.html}", note=[Accessed: 13-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_replacepixelvalue, organization={Wolfram Research}, title={ReplacePixelValue}, year={2014}, url={https://reference.wolfram.com/language/ref/ReplacePixelValue.html}, note=[Accessed: 13-August-2025]}