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:
Transformed:
Original image #2:
Transformed:
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
-
Log in to Akamai Control Center, then go to ☰ > CDN > Image and Video Manager.
-
Select the correct contract from the list.
-
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.
-
Click Add Transformation, search for Smart Crop, then click Insert Transformation.
-
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.
- 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.
- Click Save and Test on Staging.
- Apply the
impolicy
query string parameter to the end of the URL, for example:
https://www.myairportssite.com/0017/aerialgates.jpg?impolicy=smart_crop
Updated 9 months ago