ImageFileApply
ImageFileApply[f,inputfile,outputfile]
applies the function f to the list of channel values for each pixel of the image stored in inputfile and stores the result in outputfile.
Details and Options
- ImageFileApply can be used to read, process, and write successive blocks of data from a very large image file whose size could exceed available memory.
- ImageFileApply[f,inputfile] stores the result under the "Image" directory in $WolframDocumentsDirectory.
- ImageFileApply works with TIFF, JPEG, and PNG files. The created outputfile always has the same file format, data type, and dimensions as inputfile.
- ImageFileApply works on images with any number of channels.
- The image files inputfile and outputfile can be given as a string or a File object.
- The function f should always return a number or a list of any length.
- The channel values supplied to f are normally in the range 0 to 1, regardless of the underlying type used in the Image object. The function f is assumed to return channel values that are normally in the range 0 to 1.
- The following options can be given:
-
Interleaving True whether to supply f lists of channel values Method Automatic method to use - The following suboptions can be given to Method:
-
"ImageList" All frames to process from a multi-frame file "MaxBlockSize" 8000000 maximal size of image blocks in pixels loaded into the memory - For the most efficient file processing, stripes or tiles of the image may be accessed in a specific order.
- The value of the option "MaxBlockSize" may be exceeded if it is smaller than the smallest block supported for the input file.
- With "ImageList"->{l1,l2,…}, the output image only contains the processed frames.
Examples
open allclose allBasic Examples (2)
Options (3)
Interleaving (1)
Use Interleaving->False when the function has to be applied to each channel separately:
Text
Wolfram Research (2012), ImageFileApply, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageFileApply.html (updated 2020).
CMS
Wolfram Language. 2012. "ImageFileApply." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/ImageFileApply.html.
APA
Wolfram Language. (2012). ImageFileApply. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageFileApply.html