DilateErode

Function
The DilateErode function isolates each channel and cuts or adds pixels to the edge of that channel. For example, to chew into your mask, set your channels to “a,” and then set the xPixels and yPixels value to -1. By default, you work on whole pixels. To switch to subpixel chewing, enable “soften.” Note that the soften parameter really slows the function. If you use the soften feature, use low values for xPixels and yPixels.

You often select "a" as your channel and then apply a Color - MMult afterwards to multiply the RGB by the modified alpha.

Parameters
Type
Defaults
Function
channels
string
"rgba" The effected channels. Any or all of rgba.
x/yPixels
float
0, xPixels The amount of pixels added or taken on an edge. Positive values add to the edge, negative values eat away at the edge.
borders
int
0

This tells Shake to consider or ignore the border pixels.

soften
int
0 This toggle turns on softening, or effecting the sub-pixel. If this is turned on, it will considerably slow down the software at high x/yPixel values.
sharpness
float
0 The sharpness factor for the softening. A value of 0 gives a smooth gradation, whereas 2 will give you a sharp cutoff.


Synopsis

image DilateErode( image, 
  const char * channels,
  float xPixels, 
  float yPixels, 
  int borders,
  int soften
  float sharpness
);


Script

image = DilateErode(image, 
        "channels", 
        xPixels, yPixels, 
        borders, soften, sharpness          
);


Command Line

shake -dilateerode channels xPixels yPixels etc...