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

ImageSubtract

ImageSubtract[image, x]
subtracts a constant amount x from each channel value in image.
ImageSubtract[image1, image2]
gives an image in which each pixel is obtained by subtracting the values of the corresponding pixels in image1 and image2.
  • The image returned by ImageSubtract[image, ...] has the same dimensions as image.
  • If the image dimensions are different, ImageSubtract[image1, image2] subtracts image2 from the center of image1.
  • If image1 or image2 is a single-channel image, its values are subtracted from the values in each channel of the other image in ImageAdd[image1, image2].
  • If image1 and image2 are both multichannel images, the values in each channel are subtracted separately.
  • In ImageSubtract[image, x], the number x is normally in the range 0 to 1.
  • ImageSubtract[image, x] gives an image with the same underlying data type as image, clipping or truncating values if necessary.
  • ImageSubtract[image1, image2] gives an image with the largest type of either image1 and image2, clipping or truncating values if necessary.
Subtract a binary mask from a color photo:
Subtracting a constant amount from each color channel darkens an image:
Subtract a binary mask from a color photo:
In[1]:=
Click for copyable input
Out[1]=
 
Subtracting a constant amount from each color channel darkens an image:
In[1]:=
Click for copyable input
Out[1]=
Create an unsharp mask by subtracting a blurred version:
Add the unsharp mask to the original image:
New in 7