CUDAImageSubtract


subtracts an amount x from each channel value in img.


subtracts an amount x from each channel value in mem.


gives an image in which each pixel is the difference of the corresponding pixels in and .


gives a CUDAMemory in which each pixel is the difference of the corresponding pixels in and .

DetailsDetails

  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • works with binary, grayscale, and other images.
  • works with CUDAMemory and lists.
  • is equivalent to ImageSubtract[image1, val].
  • The image returned by has the same dimensions as image.
  • If is a single-channel image, each channel of is subtracted by in .
  • In , the number x is normally in the range 0 to 1.
  • gives an image with the same underlying data type as image, clipping or truncating values if necessary.
  • gives an image with the type of , clipping or truncating values if necessary.
  • The following options can be given:
  • "Device"Automaticdevice used for CUDA computation
    "OutputMemory"NoneCUDAMemory where output is stored

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

First, load the CUDALink application:

In[1]:=
Click for copyable input

This subtracts an image from another:

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

Subtracting a constant amount from each color channel darkens an image:

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

can be used to subtract rank 2 or 3 lists:

In[1]:=
Click for copyable input
Out[1]//MatrixForm=
New to Mathematica? Find your learning path »
Have a question? Ask support »