Documentation

crop Crop Mode

Controls how the input image is aligned when the fit parameter is set to crop. The w and h should be also be set. Valid values are top, bottom, left, right, faces, and entropy. Multiple values can be used by separating them with a comma ,. If no value is explicitly set, the default behavior is to center the image.

The following arguments are valid for specifying a crop mode.

  • Unset: Default. Crop to the center of the image.
  • top: Crop from the top of the image, down.
  • bottom: Crop from the bottom of the image, up.
  • left: Crop from the left of the image, right.
  • right: Crop from the right of the image, left.
  • focalpoint: When set with a relative horizontal (fp-x) and vertical (fp-y) and/ or zoom (fp-z), will select a focal point of the image to crop to.
  • faces: If faces are detected in the image, attempts to center the crop to them. Otherwise, the cropping alignment will default to centered if no additional values are provided. For example, crop=faces,top,right will crop to faces, and if there are no faces, then crops to the top, right.
  • entropy: Automatically finds and crops to an area of interest by looking for busy sections of the image.
  • edges: Automatically finds an crops to an area of interest by performing edge detection looking for objects within an image.

Focal Point

The following example illustrates the difference between the default centered crop and one made with focal point parameters to target and zoom to a portion of the image. The source image in this example is being cropped to a square.

original
Walrus

Face Detection

The following example illustrates the difference between the default centered crop and one made with facial detection turned on. The source image in this example is being cropped to a square.

Entropy and Edge Detection Automatic Cropping

The following example illustrates the difference between the entropy crop and one made with edges cropping turned on. The source image in this example is being cropped to a wide rectangle.

original
Kayak
crop=entropy
Kayak
crop=edges
Kayak