Defocus

Function
This blur function is a more accurate model of the blurring that occurs through an out-of-focus real world camera lense. It takes the highpoints, and flares them out, giving you a circular, hexagonal, or octagonal shape around the highlights.

Original image Real camera de-focus
image blurred with normal gaussian Blur in Shake image blurred with Defocus in Shake

 

Parameters
Type
Defaults
Function
x,yPixels
float
11,11 Kernal size for the defocus in pixels. Anything less than 3 does nothing. This is the general size of the flare.
channels
string
"rgba"

Which channels are calculated for the blur.

percent
float
100 The mix between the blurred and non-blurred image.
shape
string
"gaussian" Either "fast gaussian", "fast box", "circle", "square", "hexagon", or "octagon". This describes the shape of the flaring. The fast modes give you low quality but fast results.
boostPoint
float
.95 The image value where the superwhite boosting starts. If boostPoint is .75, rgb values above .75 will be boosted to increase flaring effects. A high value generally decreases flare areas, since fewer candidate pixels are flared out.
superWhite
float
1 Max value to boost image to. A value of 1 in the original will be boosted to this value. By boosting this, you increase the brightness of the flare area. Values around 50 give you a very strong boost.


Synopsis

image Defocus( image, 
  float xPixels,
  float yPixels,
  const char * channels, 
  float percent, 
  const char * shape,
  float boostPoint, 
  float superWhite
);


Script

image = Defocus( image, 
  xPixels,
  yPixels,
  "channels",
  percent,
  "shape",
  boostPoint,
  superWhite        
);


Command Line

shake -defocus xPixels yPixels channels etc...

See Also
PercentBlur, Blur , ZDefocus, IDefocus