This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

ImageApply

Updated In 8 Graphic
ImageApply
applies the function f to the list of channel values for each pixel in image.
  • ImageApply 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, 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.
  • 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->region, a region of interest to be processed can be specified.
Replace each pixel with the maximum of the color channels:

Apply a gamma correction:
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]=
Replace each channel list by its average:
Apply a pure function to each channel vector:
Use Interleaving->False when the function has to be applied to each color channel value separately:
Negate pixels in the specified region of interest:
Use built-in color gradients to add color to an image:
Add an alpha channel to a grayscale image:
Highlight a region in an image:
Functions that accept lists as their input cannot be applied on single channel images:
Rotate color channels:
Apply any coloring function to an image:
Colorize a grayscale image:
New in 7 | Last modified in 8