> 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/focal-point-crop.md).

# Focal point crop

Allows to crop an image by defining the coordinates of the crop focal point. It is useful when you want to crop images where the coordinates of the point of interest are already known.

To set the coordinates of the focal point, use the **gravity=X,Y** operation where **X** and **Y** are the coordinates of the focal point (in pixels). Alternatively, you can set the coordinates as a percentage of the original image - **gravity=Xp,Yp** or **gravity=xc,yc**, where X,Y=0..100 and x,y=0..1.

<mark style="color:orange;">**gravity=X,Y**</mark>

<mark style="color:orange;">**gravity=Xp,Yp|xc,yc**</mark>

## Examples

Original image: [/docs/castle.jpg?<mark style="color:orange;">**w=1000**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/castle.jpg?w=1000)

<figure><img src="https://fdocs.filerobot.com/docs/castle.jpg?w=1000" alt=""><figcaption></figcaption></figure>

| Preview                          | Syntax                                                                                                                                                                                                                                                                                   |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/2odjiDmLfMH3ociI3kFk) | [/samples.scaleflex.com/castle.jpg?<mark style="color:orange;">**w=450**</mark>&<mark style="color:orange;">**h=300**</mark>&<mark style="color:orange;">**gravity=1750,1000**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/castle.jpg?w=450\&h=300\&gravity=1750,1000) |
| ![](/files/dipAQagUjCI7aPtWIuM1) | [/samples.scaleflex.com/castle.jpg?<mark style="color:orange;">**w=450**</mark>&<mark style="color:orange;">**h=300**</mark>&<mark style="color:orange;">**gravity=80p,50p**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/castle.jpg?w=450\&h=300\&gravity=80p,50p)     |

{% hint style="info" %}
Please note that the focal point in **gravity=X,Y** has to be defined as coordinates **X** and **Y** of the full-sized origin image and not the scaled-down version.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cloudimage.io/transformations/image-operations/crop/focal-point-crop.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
