ImageFileScan

ImageFileScan[f,"inputfile"]
applies the function f to the list of channel values for each pixel of the image stored in .

Details and OptionsDetails and Options

  • ImageFileScan can be used to read and process successive pixel data from a very large image file whose size could exceed available memory.
  • The channel values supplied to f are normally in the range 0 to 1, regardless of the underlying type used in the Image object.
  • ImageFileScan[f,] discards the results of applying f to the pixels. Unlike ImageFileApply, ImageFileScan does not create a new file and returns Null.
  • ImageFileScan is useful in carrying out an operation on individual pixels where the operation has a "side effect", such as making an assignment.
  • ImageFileScan works with TIFF, JPEG, and PNG files.
  • ImageFileScan works on images with any number of channels.
  • ImageFileScan traverses the image in a row-wise order from left to right.
  • You can use Throw to exit from ImageFileScan. »
  • The following options can be given:
  • InterleavingTruewhether to supply f lists of channel values
    "ImageList"Allframes to process from a file with multiple images
    "MaxBlockSize"8000000maximal size of image blocks in pixels loaded into the memory
  • The value of the option may be exceeded if it is smaller than the smallest block supported for the input file.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Compute the total intensity of an out-of-core image:

In[1]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=

Out-of-core image histogram:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Compute the minimum and maximum values for each channel:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2012
(9.0)