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

Details 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 with 2D and 3D images with any number of channels.
  • ImageApply[f,image] 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 of image. The function f is assumed to return channel values that are normally in the range 0 to 1.
  • In ImageApply[f,{image1,,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 imagei, clipping or truncating values if necessary.
  • The following options can be given:
  • InterleavingTruewhether to apply f to the list of channel values or separately to each channel value
    MaskingAllregion of interest to be processed
  • In ImageApply[f,image], evaluations of f may be cached to focus on speed of getting a result.  »

Examples

open all close all

Basic Examples  (2)

Replace each pixel with the maximum of the color channels:

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

Compute the average of three color images:

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

Scope  (5)

Options  (4)

Applications  (8)

Properties & Relations  (2)

Possible Issues  (3)

Neat Examples  (4)

Introduced in 2008
(7.0)
|
Updated in 2012
(9.0)