--- title: "Rotate image" slug: "frebehav-rotate-image" updated: 2026-05-04T06:50:10Z published: 2026-05-04T06:50:10Z canonical: "docs.lobstersoftware.com/frebehav-rotate-image" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Rotate image *See also:* [Rotate image (Event action)](/v1/docs/en/doc-rotate-image-actor) > [!NOTE] > The Rotate image behavior creates a target image rotated by multiples of 90° clockwise or counterclockwise in a defined target format, beginning with an original image (in a pixel graphics format). --- > [!NOTE] > **NOTE:** > > *This behavior type is only available, if the functional extension module "Document Management" is installed and licensed.* --- ![images/download/attachments/177913928/image-2024-9-25_15-46-6-version-1-modificationdate-1727271965329-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-9-25_15-46-6-version-1-modificationdate-1727271965329-api-v2.png) The **Behavior type** [Rotate image](/v1/docs/en/frebehav-rotate-image) generates a *target image* rotated by a multiple of 90° clockwise or counter-clockwise in a defined target format from an *original image* (in a pixel graphics format). The *original image* can be provided in *FileInfo* format (for details see [File](/v1/docs/en/fre-file-vo)) or as *a ByteArray*. With regard to the origin of such data, the following alternatives exist: - If no element is linked, the *original image* must be available as input data. - If an element is linked (e.g. of [File](/v1/docs/en/fre-file-vo) or [Image/Icon](/v1/docs/en/fre-image-vo) type), the system attempts to read its value as an *original image*. The **Angle** parameter accepts negative and positive integers, which, rounded to multiples of 90, indicate the angle of rotation to be applied: - Positive values (>45°) define a clockwise rotation. - Negative values (<-45°) define a counter-clockwise rotation. - For example, a rotation angle of -90° is equivalent to a rotation angle of 270°. The selection for the **Type** defines the target format for the rotated image. The format `image/png` is preset here. **NOTE:** The alternative target format `image/jpeg` does not support transparent color. Therefore, transparent pixels in the original may appear in black (see example). If unsuitable or no data is available for the *original image* at runtime, the **Actions on "false"** are executed with an error object as input data (`$input`). If the *original image* can be processed successfully, the data of the rotated image is passed to the **Actions on "true"**. There the rotated image, e.g. by [Set value](/v1/docs/en/freaction-set-value), can be assigned to a suitable target element. ## Example In a portal, a loaded original image is converted into a certain target format and then optionally rotated to create a target image, which can be saved. Runtime example: ![images/download/attachments/177913928/image2020-5-11_12-44-29-version-1-modificationdate-1727271811912-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-5-11_12-44-29-version-1-modificationdate-1727271811912-api-v2.png) - Here an pixel graphics image in `image/png` format that uses a transparent background has been loaded into an [Image/Icon](/v1/docs/en/fre-image-vo) element "Original image". - A click on the [Button](/v1/docs/en/fre-button-vo) "►JPG" transfers the image data into the [Image/Icon](/v1/docs/en/fre-image-vo) elements "Target format" and "Target image" and converts them into `image/jpeg`. - This is achieved by the behavior type [Rotate image](/v1/docs/en/frebehav-rotate-image) with **Type** `image/jpeg` and **Angle** 0. ![images/download/attachments/177913928/image2020-5-11_12-45-0-version-1-modificationdate-1727271811902-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-5-11_12-45-0-version-1-modificationdate-1727271811902-api-v2.png) - In a second interactive step, the "target image" was rotated here by clicking the "-90°" [Button](/v1/docs/en/fre-button-vo). - This is achieved by the behavior type [Rotate image](/v1/docs/en/frebehav-rotate-image) with the configuration shown below. Configuration: *Only the configuration for the* [Button](/v1/docs/en/fre-button-vo) *"-90°" is explained here.* | ![images/download/attachments/177913928/image-2024-9-26_10-56-26-version-1-modificationdate-1727340985991-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-9-26_10-56-26-version-1-modificationdate-1727340985991-api-v2.png) | - For the [Button](/v1/docs/en/fre-button-vo) "-90°" a behavior is configured that reacts to the **Triggering event** [Click](/v1/docs/en/fretrigger-clicked). --- - The **Behavior type** [Rotate image](/v1/docs/en/frebehav-rotate-image) is used here with the linked element "Target image" ([Image/Icon](/v1/docs/en/fre-image-vo)). --- - To demonstrate the rounding logic, an **Angle** of -46 was specified here, which causes a 90° counter-clockwise rotation. A value of 90 would be functionally equivalent and more transparent. --- - The format `image/png` was chosen as **Type** for the target image. --- - Under the **Actions on "true"**, the [Set value](/v1/docs/en/freaction-set-value) action is called to assign the rotated image (`$input`) to the [Image/Icon](/v1/docs/en/fre-image-vo) element "Target image". **NOTE:** Since the target image is also linked as a data source for the image data, the [Button](/v1/docs/en/fre-button-vo) can be clicked repeatedly to rotate the image counter-clockwise in steps of 90°. | | --- | --- |