# Rotate

Rotates the image by a specified angle, counterclockwise. You can use **bg\_color=X** to set the background fill color if the rotation angle is not divisible by 90.

<mark style="color:orange;">**r=X**</mark>

## Examples

| Preview                          | Syntax                                                                                                                                                                                                                                                                            |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/bXA2ygFHTs1GRaIlNM1S) | [/samples.scaleflex.com/earth.jpg?<mark style="color:orange;">**w=400**</mark>&<mark style="color:orange;">**r=90**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/earth.jpg?w=400\&r=90)                                                                          |
| ![](/files/7A6ESN05dOAjrZ9R4Yst) | [/samples.scaleflex.com/earth.jpg?<mark style="color:orange;">**w=400**</mark>&<mark style="color:orange;">**r=15**</mark>&<mark style="color:orange;">**bg\_color=10100E**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/earth.jpg?w=400\&r=15\&bg_color=10100E) |

{% hint style="info" %}
Please note that image rotation is performed *before* resizing operations.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.cloudimage.io/transformations/image-operations/rotate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
