> 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/rotate.md).

# 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 %}
