How can I control the zoom level using face or custom cropping?

Cloudinary supports cropping images according to detected faces or to pre-assigned custom-coordinates.
For instance, automatic face-detection crops the image to only the area of the face, e.g.:

http://res.cloudinary.com/demo/image/upload/c_crop,g_face/face_left.jpg

In order to control the default zoom level of the automatic cropping, use the `zoom` parameter (`z_` in URLs) as a multiplier of the default value of 1.

For example

Zoom-out to 70% (values between 0 to 1):
http://res.cloudinary.com/demo/image/upload/c_crop,g_face,z_0.7/face_left.jpg

Zoom-in to 130% (values of 1 and above):
http://res.cloudinary.com/demo/image/upload/c_crop,g_face,z_1.3/face_left.jpg

You can also override the default zoom for custom cropping, e.g.:

http://res.cloudinary.com/<cloud_name>/image/upload/c_crop,g_custom,z_0.8/my_image.jpg

For more information regarding the Zoom parameter (and much more), you can refer to our Blog.

Have more questions? Submit a request

Comments

Powered by Zendesk