ImageApply

ImageApply[f, image]
applies the function f to the list of channel values for each pixel in image.

ImageApply[f, {image1, image2, ...}]
applies f to the sequence of corresponding pixel values taken from each .

Details and OptionsDetails and Options

  • ImageApply[f, image] replaces the list of channel values for each pixel by the result of applying the function f to the list.
  • ImageApply works on images with any number of channels.
  • ImageApply returns an image of the same type as image.
  • In ImageApply[f, image], the function f can 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.
  • In ImageApply[f, {image1, image2, ..., imagen}], f is supplied with n arguments. »
  • ImageApply[f, {image1, image2, ...}] works with any number of commensurate images.
  • ImageApply[f, {image1, image2, ...}] gives an image with the largest type of , clipping or truncating values if necessary.
  • ImageApply has the option Interleaving, which specifies whether f should be applied to individual channel values or to the complete list of channel values for a given pixel. The default setting is Interleaving->True.
  • With the setting Masking->roi, a region of interest to be processed can be specified.
  • ImageApply works with Image3D objects.

ExamplesExamplesopen allclose all

Basic Examples (5)Basic Examples (5)

Replace each pixel with the maximum of the color channels:

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


Apply a gamma correction:

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

Compute the average of three color images:

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

Compute the maximum of each of the pixel values:

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

Apply a function to pixels of a 3D gradient image:

In[1]:=
Click for copyable input
Out[1]=
New in 7 | Last modified in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »