Crop

Function
This function crops the image by defining the lower-left corner and the upper-right corner of the crop. Since the numbers can be greater or less than the boundaries of the image, you can make the image smaller or expand its size with a black border. A Crop will cut off elements beyond its frame area, so if you later use another transform (ie, Pan, Move2D, etc) to move the image, black will be brought in. This is how it differs from Viewport, as Viewport will not cut off the image. Jump to Viewport for an example. Window is also the same command, but you set the lower-left corner, and then the X and Y resolution.

Crop is particularly helpful in that it sets a new frame area. Shake only processes nodes within the frame, so to speed up an operator you can limit its area with a Crop. This is essentially what is done with the Constraint node.

Parameters
Type
Defaults
Function
cropLeft, Bottom, Right, Top
float
0,0, width, height
These represent the lower left and upper right corners of the crop region. Note that the area generated is up to, but not including, the upper right since 0,0 represents the lower left corner of the lower left pixel.


Synopsis

image Crop( image,
  int cropLeft, 
  int cropBottom,
  int cropRight, 
  int cropTop
);


Script

image = Crop( image, 
        cropLeft, cropBottom, 
        cropRight, cropTop
);


Command Line

shake -crop cropLeft cropBottom etc...

Example

shake lisa.iff -crop 100 200 400 500
shake lisa.iff -crop -100 -100 width+100 height+100


See Also
ViewPort, Window