Smart Crop

Use Smart Crop to intelligently optimize cropping and resizing of images around prominent faces and features using computer vision.

Smart Crop combines the capabilities of the Face Crop and Feature Crop transformations to automatically detect faces and important features in an image. If one or more faces are detected, Smart Crop crops around them, preserving as many complete faces as possible within the specified dimensions. If no faces are detected, Smart Crop crops around the most prominent feature(s).

For more information about the underlying technology, see Face Crop and Feature Crop.

To perform a Smart Crop transformation, specify your crop dimensions and select one of the following crop types:

  • Fill (default): Scales the crop area to include as much of the area around the faces or features as possible, relative to the specified width and height. The Fill crop style is suitable for most use cases.

📘

You don't have to provide both dimensions

If width or height isn't specified, Image and Video Manager chooses a dimension to include as much of the original image as possible, resulting in a transformation equivalent to a simple resize.

  • Crop: Performs a raw crop around faces/features.
  • Zoom: Scales the crop area as small as possible to fit the faces/features, relative to the specified width and height. This results in a tighter crop around prominent faces or features.

For example, if you have the following image:

image before Smart Crop

and apply Smart Crop using the Fill crop style, a width of 300 pixels and a height of 800 pixels, you get the following transformed image:

image after Smart Crop

Because faces were detected, but the image dimensions were too narrow to preserve more than one complete face, Image and Video Manager cropped around the most prominent face. If no faces had been detected, Image and Video Manager would've cropped around the most prominent feature(s).

📘

If you add the IMQuery transformation to a policy, use the im variable, and select Smart Crop, you can use the query string to crop around the most prominent faces or features in an image. See Syntax and Examples for the syntax for the query string parameter.