> For the complete documentation index, see [llms.txt](https://docs.cloudimage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudimage.io/transformations/image-operations/crop/automatic-gravity-crop.md).

# Automatic gravity crop

Chooses the most important image features and objects and sets the focal point on them when cropping.

<mark style="color:orange;">**gravity=smart**</mark>

<mark style="color:orange;">**gravity=auto**</mark>

<mark style="color:orange;">**gravity=face**</mark>

<mark style="color:orange;">**gravity=meta**</mark>

## Smart gravity

Sets the crop focal point on the people in the image or on the most prominent features if no faces are detected. Useful for creating thumbnails from images with different aspect ratios.

### Examples

| Preview                          | Syntax                                                                                                                                                                                                                                                                                 |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/dYgrJzhHo82xiPV5HJmd) | [/samples.scaleflex.com/mountains.jpg?<mark style="color:orange;">**w=300**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/mountains.jpg?w=300)                                                                                                                         |
| ![](/files/8l085gVnb5YXqJliJ3w4) | [/samples.scaleflex.com/mountains.jpg?<mark style="color:orange;">**h=300**</mark>&<mark style="color:orange;">**w=300**</mark>&<mark style="color:orange;">**gravity=smart**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/mountains.jpg?h=300\&w=300\&gravity=smart) |
| ![](/files/BecCkY5Gtjj0v5liiq2N) | [/samples.scaleflex.com/hotel.jpg?<mark style="color:orange;">**h=300**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/hotel.jpg?h=300)                                                                                                                                 |
| ![](/files/d5QyY3VbesVLR8QmeAfZ) | [/samples.scaleflex.com/hotel.jpg?<mark style="color:orange;">**h=300**</mark>&<mark style="color:orange;">**w=300**</mark>&<mark style="color:orange;">**gravity=smart**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/hotel.jpg?h=300\&w=300\&gravity=smart)         |

## Automatic gravity

Setting the **gravity** parameter to **auto** finds the focal point of the image based on entropy.

### Examples

| Preview                          | Syntax                                                                                                                                                                                                                                                                     |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/4RNiaFbDxAVs7bUqQn2u) | [/samples.scaleflex.com/boat.jpg?<mark style="color:orange;">**h=300**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/boat.jpg?h=300)                                                                                                                       |
| ![](/files/I5mIbAB861lrZ53VTe8l) | [/samples.scaleflex.com/boat.jpg?<mark style="color:orange;">**h=300**</mark>&<mark style="color:orange;">**w=300**</mark>&<mark style="color:orange;">**gravity=auto**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/boat.jpg?h=300\&w=300\&gravity=auto) |

## Face gravity

When using **gravity=face**, all images with one dominant face are focused on this face upon cropping. If there are many or no faces in the image, **gravity** falls back to **auto**.

{% hint style="info" %}
If you would like to try and include multiple faces in the image, you can use **gravity=smart**
{% endhint %}

### Examples

| Preview                          | Syntax                                                                                                                                                                                                                                                                               |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ![](/files/fiNHLAmbFCdmIsApv5q6) | [/samples.scaleflex.com/classroom.jpg?<mark style="color:orange;">**h=300**</mark>&<mark style="color:orange;">**w=300**</mark>&<mark style="color:orange;">**gravity=face**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/classroom.jpg?h=300\&w=300\&gravity=face) |

## Metadata gravity

When using **gravity=meta**, all images having a custom focus point defined in the library will use this as if using the `focal point crop`. If there is no `focus point` defined in the image metadata, **gravity** falls back to **auto**.

{% hint style="info" %}
You can override the fallback by chaining the methods, so that in case there is no `focus point` defined in the library's image metadata, it would proceed using another method like face, trim, or other.&#x20;

eg. of use: **gravity=meta,face**
{% endhint %}
