ImageScan [f,image]
evaluates f applied to each pixel of image in turn.
ImageScan
ImageScan [f,image]
evaluates f applied to each pixel of image in turn.
Details and Options
- The channel values supplied to f are normally in the range 0 to 1, regardless of the underlying type used in the Image object.
- ImageScan [f,image] discards the results of applying f to the pixels in image. Unlike ImageApply , ImageScan does not build up a new image and returns Null .
- ImageScan is useful in carrying out an operation on parts of expressions where the operation has a "side effect", such as making an assignment.
- ImageScan works on images with any number of channels.
- You can also use Throw to exit from ImageScan . »
- ImageScan traverses the pixels of image in a row-wise order from left to right.
- ImageScan works with Image3D objects.
- ImageScan takes the following options:
-
- With Interleaving True , the function f is applied to the complete list of channel values for a given pixel, otherwise, f is applied to individual channel values.
Examples
open all close allBasic Examples (2)
Scan pixels of a grayscale image:
Scan pixels of a color image and print the values in their color:
Scope (4)
Scan pixels of a grayscale image:
Scan pixels of a transparent image:
Scan pixels of a color image:
Scan pixels of a 3D image:
Options (4)
Interleaving (2)
By default, lists of channel values are scanned:
Using Interleaving->False , individual channel values can be scanned:
The interleaving setting does not affect the traversal of a single-channel image:
Masking (2)
By default, all image pixels are scanned:
Scan only the pixels specified by the mask:
Compute the mean color of the Spikey:
Create a disk of the computed mean color:
Mean color computed without masking:
Applications (2)
Count the number of white pixels in an image:
Compute the mean pixel value:
Properties & Relations (1)
See Also
Related Guides
History
Text
Wolfram Research (2012), ImageScan, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageScan.html.
CMS
Wolfram Language. 2012. "ImageScan." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ImageScan.html.
APA
Wolfram Language. (2012). ImageScan. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageScan.html
BibTeX
@misc{reference.wolfram_2025_imagescan, author="Wolfram Research", title="{ImageScan}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/ImageScan.html}", note=[Accessed: 17-November-2025]}
BibLaTeX
@online{reference.wolfram_2025_imagescan, organization={Wolfram Research}, title={ImageScan}, year={2012}, url={https://reference.wolfram.com/language/ref/ImageScan.html}, note=[Accessed: 17-November-2025]}