Crop around important faces or features

Image and Video Manager can automatically detect faces and important features in your images, and intelligently crop around them. If you're interested in cropping around faces, you can use the Face Crop transformation. If you're interested in cropping around prominent features, you can use the Feature Crop transformation. If you want the crop around whatever is most important in the image—faces if present, features if not—consider using Smart Crop. If faces are detected, Smart Crop preserves as many complete faces as possible within the specified dimensions. If no faces are detected, Smart Crop crops around the most prominent feature(s).

Examples of the impact on images

In the following two examples, the Smart Crop transformation was applied using the Fill crop style, a width of 300 pixels, and a height of 800 pixels.

In the first example, there are three faces in the image, but the crop dimensions are too narrow to preserve more than one complete face, so the crop is applied to the most prominent face.

In the second example, no faces were detected, so the crop is applied to the most prominent feature.

Original image #1:

image before Smart Crop

Transformed:

image after Smart Crop

Original image #2:

image before Smart Crop

Transformed:

image before Smart Crop

How to

📘

Before you begin, you should know the URL of the image you want to crop, for example:

https://www.myairportssite.com/0017/aerialgates.jpg
  1. Log in to ​Akamai Control Center​, then go to > CDN > Image and Video Manager.

  2. Select the correct contract from the list.

  3. Create a new policy:

    • Click +Create, then click Policy on the menu that appears.
    • Select the policy set to which you wish to add the new policy.
    • Give your new policy a name, for example, "smart_crop".
    • Click Create.

    Policy Editor opens.

  4. Click Add Transformation, search for Smart Crop, then click Insert Transformation.

  5. Specify the dimensions of the cropped image in the Width and Height fields.

📘

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.

  1. Select Fill from the Crop style menu.

This 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. This crop style is suitable for most use cases.

  1. Click Save and Test on Staging.
  2. Apply the impolicy query string parameter to the end of the URL, for example:
https://www.myairportssite.com/0017/aerialgates.jpg?impolicy=smart_crop