# Image

#### Available properties:

| Property                                                                                                                                                                                                   | Description                                                                                                                                                                                                                                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image\_url**                                                                                                                                                                                             | <p>String: <strong>HTTP(s) URL of your image</strong>. i.e: <em><code><https://www.abyssale.com/imge/abyssale_logo.png></code></em><br><br><em>It must be a public accessible link and be 10 mo maximum.</em><br>Supported files: <strong>jpeg</strong>, <strong>png</strong>, <strong>webp</strong>, <strong>svg, gif</strong>.<br></p> |
| **image\_encoded**                                                                                                                                                                                         | <p>String: <strong>Base64 encoded image as value.</strong></p><p></p><p>i.e.: /<code>9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...</code></p><p></p><p><em>If the <code>image\_url</code> is given, this property will be ignored.</em></p>                                                                                                  |
| **`opacity`**                                                                                                                                                                                              | Integer between 0 and 100. **Opacity of the image**                                                                                                                                                                                                                                                                                      |
| **`fitting_type`**                                                                                                                                                                                         | [Go to Fitting Type documentation](#fitting-type)                                                                                                                                                                                                                                                                                        |
| **`alignment`**                                                                                                                                                                                            | [Go to Alignment documentation](#alignment)                                                                                                                                                                                                                                                                                              |
| <p><strong><code>mask\_name</code></strong><br><strong><code>mask\_properties</code></strong></p>                                                                                                          | [Go to Mask documentation](#mask)                                                                                                                                                                                                                                                                                                        |
| <p><strong><code>filter\_name</code></strong><br><strong><code>filter\_properties</code></strong></p>                                                                                                      | [Go to Filter documentation](#filter)                                                                                                                                                                                                                                                                                                    |
| <p><strong><code>overlay\_direction</code></strong><br><strong><code>overlay\_color\_1</code></strong><br><strong><code>overlay\_color\_2</code></strong></p>                                              | [Go to Overlay documentation](#overlay)                                                                                                                                                                                                                                                                                                  |
| <p><strong><code>shadow\_color</code></strong><br><strong><code>shadow\_blur</code></strong><br><strong><code>shadow\_offset\_x</code></strong><br><strong><code>shadow\_offset\_y</code></strong><br></p> | [Go to Shadow documentation](https://developers.abyssale.com/rest-api/generation/element-properties/..#shadow)                                                                                                                                                                                                                           |
| <p><strong><code>remove\_bg</code></strong><br><strong><code>remove\_bg\_properties</code></strong></p>                                                                                                    | [Go to Remove bg documentation](#alignment-1)                                                                                                                                                                                                                                                                                            |
| <p><strong><code>auto\_focus</code></strong><br><strong><code>auto\_focus\_properties</code></strong></p>                                                                                                  | [Go to Auto Focus documentation](#alignment-2)                                                                                                                                                                                                                                                                                           |
| **`text_to_image`**                                                                                                                                                                                        | <p><a href="#alignment-3">Go to text to image documentation</a><br><br><em>If the <code>image\_url</code>  (except default image) or <code>image\_encoded</code> is given, this property will be ignored.</em></p>                                                                                                                       |

## Fitting Type <a href="#fitting-type" id="fitting-type"></a>

`fitting_type`: That defines the way the image will be inserted in the bounding box.

Two properties are supported:

* **`cover`**: It will force the image to fill entirely the area without changing the aspect ratio *(hence the image will be cropped if its ratio is not the same as the container)*
* **`fill`**: The image will be displayed entirely within the box.

#### Examples:

| `"fitting_type": "fill"`  | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FWyxhaQW3HWi4ajn0XZiw%2Fcontain.jpg?alt=media\&token=c6102c31-4f6c-4aac-8527-e2ddd12130ad) |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `"fitting_type": "cover"` | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FABb4t0UMS3Y3R54AIw7l%2Fcover.jpg?alt=media\&token=f5368f47-a8c1-407d-b485-02f890276d2d)   |

## Alignment <a href="#alignment" id="alignment"></a>

`alignment` can be defined to override the default image alignment.<br>

It can be of two forms:

* One string: `top`, `middle`, `bottom`, `left`, `center`, `right`
* Two strings: One vertical alignment parameter (`top`, `middle`, `bottom`) associated with a horizontal alignment parameter (`left`, `center`, `right`) separated by a space. i.e: (`top left` , `middle right`)

#### **Examples:**

|                                                    |                                                                                                                                                                                                                                    |
| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| (fitting\_type: cover): `alignment: middle center` | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FABb4t0UMS3Y3R54AIw7l%2Fcover.jpg?alt=media\&token=f5368f47-a8c1-407d-b485-02f890276d2d)                |
| (fitting\_type: cover): `alignment: middle right`  | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FnrNKG6c6ZkyahSbcNsp9%2Fcover-middle-right.jpg?alt=media\&token=23b5c8ba-718f-4330-9123-46ccddb9b538)   |
| (fitting\_type: fill) `alignment: bottom center`   | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FQxUDjxvqTbtP9zc9FLIJ%2Fcontain-bottom-right.jpg?alt=media\&token=087c0d0a-6353-45a4-93b4-4bcd70eb8bb4) |
| (fitting\_type: fill) `alignment: middle center`   | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FWyxhaQW3HWi4ajn0XZiw%2Fcontain.jpg?alt=media\&token=c6102c31-4f6c-4aac-8527-e2ddd12130ad)              |

## Mask <a href="#mask" id="mask"></a>

A mask can be added to the image by using the `mask_name` property:

* **`circle`**: The image will be rendered as a circle. No additional property is available.
* **`rounded_corners`**: Corners of the image will be rounded. It requires another property: `mask_properties`.
* `blob` The image will be rendered as a blob. No additional property is available.
* `squircle`: The image will be rendered as a squircle. No additional property is available.
* `pentagon`: The image will be rendered as a pentagon. No additional property is available.

`mask_properties`: *Dict*

* &#x20;Only support `radius` (integer) as parameter. This parameter should only be used in combination with `rounded_corners`.

#### Examples:

<table data-header-hidden><thead><tr><th width="388"></th><th></th></tr></thead><tbody><tr><td>(fitting_type: fill) <code>mask_name: circle</code></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FS64U6mcFnG3hxRtO7LuN%2Fimage-mask-circle-c2620ca2.jpeg?alt=media&#x26;token=8a12f4e3-28c2-4e21-a1cc-5feba3ac747d" alt=""></td></tr><tr><td>(fitting_type: fill)<br><code>"mask_name": "rounded_corners",</code><br><code>"mask_properties": {</code><br>   <code>"radius": 10</code><br><code>}</code></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F3Cp5Cj085OSJ5g1gVGFT%2Fimage-mask-rounded-corners-62c0bcd5.jpeg?alt=media&#x26;token=391023b7-7244-4620-8205-36dbce5cf315" alt=""></td></tr><tr><td>(fitting_type: fill) <code>mask_name: blob</code></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FT7yLpFsGD9oBYXQVy9Vk%2FScreenshot%202022-11-17%20at%2017.59.12.png?alt=media&#x26;token=ab2031ab-6915-475e-8062-19790ed6a7be" alt=""></td></tr><tr><td>(fitting_type: fill) <code>mask_name: squircle</code></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F5x6YBAkWiWID2Dlx1JiF%2FScreenshot%202022-11-17%20at%2018.00.30.png?alt=media&#x26;token=2da3360c-c340-406e-a0ca-7a3a649c9013" alt=""></td></tr><tr><td>(fitting_type: fill) <code>mask_name: pentagon</code></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FCTmDhmyzJmCEb5vL9Qvs%2FScreenshot%202022-11-17%20at%2018.02.24.png?alt=media&#x26;token=452f2f7d-97ae-4dc6-a048-5c2e38c716e7" alt=""></td></tr><tr><td>(fitting_type: fill) <code>mask_name: hexagon</code></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FdBnOFdnUUfQ2UrANT8Mz%2FScreenshot%202022-11-24%20at%2012.14.10.png?alt=media&#x26;token=bfdc9dd7-aa52-4108-a3f1-6a1b7063e381" alt=""></td></tr><tr><td>(fitting_type: fill) <code>mask_name: parallelogram</code></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FYbtH77YKVexD3pyY6NF0%2FScreenshot%202022-11-24%20at%2012.15.13.png?alt=media&#x26;token=4f17388a-8298-4caa-9966-84d58d9ac41e" alt=""></td></tr></tbody></table>

## Filter <a href="#filter" id="filter"></a>

A filter can be added to the image by using the `filter_name` property:

* **`grayscale`**: It converts the input image to grayscale. No additional property is available.
* **`duotone`**: Apply a duotone filter to the image. It requires another property: `filter_properties`.

`filter_properties`: Dict. Only support `name` (string) as parameter. This parameter should only be used in combination with `duotone`.

#### Available list of duotone names:

|                                   `blue_orange` ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F8vUjSjXcBTxbm0YSFmnL%2Fimage-filter-duotone-blue_orange-de53f019.jpg?alt=media\&token=ac037af2-d262-4966-96eb-9e58d39889d7)                                   | <p><code>deep\_green\_light\_green</code> </p><p></p><p><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FFO5t8xsEnWynbcQTse0P%2Fimage-filter-duotone-deep_green_light_green-ba8e8b5c.jpg?alt=media&#x26;token=fbd2bd01-a020-4b4d-8c5e-dabe89c5766a" alt=""> </p> | <p><code>BrightRed\_light\_yellow</code> </p><p><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FU6k9D1FRODSsmV8zW6Yu%2Fimage-filter-duotone-BrightRed_light_yellow-22954f4b.jpg?alt=media&#x26;token=1c8af75c-9c81-4754-9340-f4452c60588f" alt=""></p> |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|        <p><code>brown\_pale\_green</code></p><p><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FMJZVEOBz6FLpxS2Nangr%2Fimage-filter-duotone-brown_pale_green-41b10dc1.jpg?alt=media&#x26;token=0596ef2b-cb6e-4718-8c79-ccb0e39bbc44" alt=""></p>        |                  <p><code>brown\_beige</code></p><p><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FNDAg3MY9WadYeqKC3yKd%2Fimage-filter-duotone-brown_beige-2002ded6.jpg?alt=media&#x26;token=ca5d6c54-2d35-4472-91d9-d8a33f5d17d6" alt=""></p>                 |         <p><code>deep\_blue\_green</code></p><p><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fv5O5oRLdsKrXkJuKRyzT%2Fimage-filter-duotone-deep_blue_green-e279d6ec.jpg?alt=media&#x26;token=36ad4f99-a2ca-4fef-9d69-bc17037ff843" alt=""></p>        |
|           <p><code>deep\_blue\_red</code></p><p><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F30bAvLW48jTrDqRtCEEo%2Fimage-filter-duotone-deep_blue_red-faf084b1.jpg?alt=media&#x26;token=437a8a51-f0d2-48b0-9020-8724a52d04d9" alt=""></p>           |          <p><code>deep\_purple\_orange</code></p><p><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F1saiPtuq0bD16DGhqCdY%2Fimage-filter-duotone-deep_purple_orange-a3fa4f2d.jpg?alt=media&#x26;token=adacbe8d-652b-479d-8e0a-ed5a528e8402" alt=""></p>          |       <p><code>deep\_purple\_beige</code></p><p><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fsxr44vl7zX4r1LD9MAxB%2Fimage-filter-duotone-deep_purple_beige-297acaba.jpg?alt=media&#x26;token=d0678c68-c70b-453f-b836-1fb60ff49bc0" alt=""></p>      |
| <p><code>deep\_purple\_pale\_green</code> </p><p><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FiliAbTV1eRY2jqllHVjj%2Fimage-filter-duotone-deep_purple_pale_green-04c0de3e.jpg?alt=media&#x26;token=263f0d95-28cf-4285-a203-d7fcb38be3d3" alt=""></p> |                               `deep_blue_pale_green`![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FAMXIdZDC2WIDtLteUwfr%2Fimage-filter-duotone-deep_blue_pale_green-43868976.jpg?alt=media\&token=02a6c676-1ecb-486c-a1be-cc352cf90de5)                              |                                                                                                                                                                                                                                                                                                                                          |

#### Examples

| (Original image)                                                                                                                                   | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FFZIsUOwwp6uxkVYXrl0H%2Fimage-original-dc5392be.jpeg?alt=media\&token=e505eb0b-b924-43f5-ae77-e3d6a21d661b)                   |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `filter_name: grayscale`                                                                                                                           | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fx8GQbqM0VPeKlPz5xBdQ%2Fimage-filter-grayscale-d88c8412.jpeg?alt=media\&token=89593ffc-8674-4a8a-8350-038cc17ae30a)           |
| <p><code>"filter\_name": "duotone",</code><br><code>"filter\_properties": {</code><br>   <code>"name": "blue\_orange"</code><br><code>}</code></p> | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FKy3M7HaidXpZxISUo5jx%2Fimage-filter-duotone-blue_orange-de53f019.jpeg?alt=media\&token=2393fe1a-61fb-4631-9e07-249abfc44b38) |

## Overlay <a href="#overlay" id="overlay"></a>

A (monochrome or gradient) overlay can be added to the image.

The 3 following properties are required:

* **`overlay_direction`**: String. Direction of the overlay. Can be `horizontal`, `vertical` or `diagonal`
* **`overlay_color_1`**: String. First color of the overlay. 6-8 Digits Hexa color.
* **`overlay_color_2`**: String. Second color of the overlay. 6-8 Digits Hexa color.

If you want a monochrome overlay, just set the 2 colors properties with the same color (in that case, the direction is then useless).

#### Examples:

|                                                                                                                                                                                                                   |                                                                                                                                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>Gradient:<br><code>"overlay\_direction": "horizontal"</code><br><code>"overlay\_color\_1": "#FF000080"</code> (alpha hexa 80 = 0.5)<br><code>"overlay\_color\_2": "#0000FF1A"</code> (alpha hexa 1A = 0.1)</p> | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fp9g5vhNK6oRGOflaatFP%2Fimage-overlay-gradient-horizontal-18981220.jpeg?alt=media\&token=7cc7c25f-ce31-4108-b791-237e8599b7a8) |
| <p><code>"overlay\_direction": "vertical"</code><br><code>"overlay\_color\_1": "#FF000080"</code><br><code>"overlay\_color\_2": "#0000FF1A"</code></p>                                                            | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FjMqH6rSqmR6sLSk3GevG%2Fimage-overlay-gradient-vertical-a5dd8b58.jpeg?alt=media\&token=3194d6d8-b286-4464-89b7-e5f441576867)   |
| <p><code>"overlay\_direction": "diagonal"</code><br><code>"overlay\_color\_1": "#FF000080"</code><br><code>"overlay\_color\_2": "#0000FF1A"</code></p>                                                            | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FvyyrFzI0CuWjBsUlJh5i%2Fimage-overlay-gradient-diagonal-18ddadd6.jpeg?alt=media\&token=b0a26d6b-131c-4f0f-8b4a-b87862fc96b7)   |
| <p>Monochrome<br><code>"overlay\_direction": "horizontal"</code><br><code>"overlay\_color\_1": "#FF000080"</code><br><code>"overlay\_color\_2": "#FF000080"</code></p>                                            | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FzZGDJftspzLP6CH6AGMW%2Fimage-overlay-monochrome-d62cf0c9.jpeg?alt=media\&token=f2e5a4d9-8f1f-43a2-b6fc-cdb0201427f9)          |

## Remove Background <a href="#alignment" id="alignment"></a>

The background removal feature allows you to automatically remove the background from images and optionally crop the edges. Effortlessly remove the background from any image with advanced AI models. This feature is perfect for creating polished, professional visuals, such as product photos or profile images.

*<mark style="color:orange;">AI Beta</mark> : Results may be inconsistent or unexpected as we continue to improve.*

* **Customizable Edge Cropping**: Trim the edges of the image after background removal for cleaner results.

<table><thead><tr><th width="289">Parameter</th><th width="112">Type</th><th width="248">Description</th><th>Default</th></tr></thead><tbody><tr><td><code>remove_bg</code></td><td>Boolean</td><td>Activates background removal when set to<code>true</code>.</td><td><code>false</code></td></tr><tr><td><code>remove_bg_properties</code></td><td>Object</td><td>Contains additional settings for background removal.</td><td></td></tr><tr><td><code>remove_bg_crop</code></td><td>Boolean</td><td>Trims the edges of the image after background removal.</td><td><code>false</code></td></tr></tbody></table>

#### Examples:

```json
"remove_bg": true,
"remove_bg_properties": {
    "remove_bg_crop": true
}
```

<table><thead><tr><th width="376"></th><th></th></tr></thead><tbody><tr><td>"remove_bg": false</td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FwreXh9Mt6WEqxMdZo2Gl%2Ftext_ex_api.jpg?alt=media&#x26;token=027a143e-aa27-4875-96fa-1ece20c46416" alt=""></td></tr><tr><td>"remove_bg": true</td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F6BjGaV6xlQ5rw0wE90aC%2Frmbg_true.png?alt=media&#x26;token=c49f66b8-6cb2-49e8-992a-f33e679ff631" alt="" data-size="original"></td></tr><tr><td><p>"remove_bg": true, </p><p>"remove_bg_properties":{</p><p>            "remove_bg_crop": true </p><p>}</p></td><td>                         <img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fu3zgC66lFc61tcd0jNKu%2Frmbg_true_trim%20(1).png?alt=media&#x26;token=f27ce563-74bb-452a-a90c-6c199f1698e8" alt="" data-size="original"></td></tr></tbody></table>

## Auto Focus <a href="#alignment" id="alignment"></a>

The auto-focus feature automatically detects and focuses on specified objects within the image using AI-powered object detection. Harness the power of advanced AI models to automatically identify and enhance focus on specific objects or people in your images. This feature excels at creating visually striking compositions by ensuring your intended subjects stand out.

*<mark style="color:orange;">AI Beta</mark> : Results may be inconsistent or unexpected as we continue to improve.*

The feature supports two specialized models:

* **Generic Model**: Optimized for detecting a wide range of objects and subjects, perfect for product photography and general purpose use. Specify a list of objects to focus on, such as "Person," "Car," or "Dog" etc...
* **Face Model**: Specifically tuned for human face detection, ideal for portrait photography and profile images

Common use cases include:

* E-commerce: Automatically focus on products in catalog photos
* Real estate: Enhance focus on key property features like windows or furniture
* Event photography: Keep focus on people or specific objects in busy scenes
* Car dealerships: Ensure vehicles are the focal point in listings
* Fashion: Focus on specific clothing items or accessories

<table><thead><tr><th width="263">Parameter</th><th width="96">Type</th><th width="267">Description</th><th>Default</th></tr></thead><tbody><tr><td><code>auto_focus</code></td><td>Boolean</td><td>Activates the auto-focus feature when set to <code>true</code>.</td><td><code>false</code></td></tr><tr><td><code>auto_focus_properties</code></td><td>Object</td><td>Contains additional settings for auto-focus.</td><td></td></tr><tr><td><code>model</code></td><td>String</td><td><p>Specifies the model used for focusing.</p><p>Accepted values are <mark style="color:green;"><code>generic</code></mark> /   <mark style="color:green;"><code>people</code></mark> or <mark style="color:green;"><code>face</code></mark>.</p></td><td><code>generic</code></td></tr><tr><td><code>focus_objects</code></td><td>Array of Strings</td><td><p>List of objects to focus on. </p><p>Use labels from the <a href="../../../annexes#open-image-object-labels">Open Images Dataset</a>. </p><p>(only for<mark style="color:green;"><code>generic</code></mark>model)</p></td><td>N/A</td></tr><tr><td><code>focus_framing</code></td><td>String</td><td><p><strong>Specific to </strong><mark style="color:green;"><strong><code>people</code></strong></mark><strong> model</strong><br></p><p>Defines which part of the subject's body the auto focus should frame. Accepted values:</p><ul><li><mark style="color:green;"><code>face</code></mark> : Crops tightly to the face only, excluding hair and headwear.</li><li><mark style="color:green;"><code>head</code></mark> : Frames the full head, including hair, hats, and other headwear.</li><li><mark style="color:green;"><code>shoulders</code></mark> : Frames the head and shoulders.</li><li><mark style="color:green;"><code>full_body</code></mark> : Frames the entire body.</li></ul></td><td><code>face</code></td></tr><tr><td><code>focus_zoom</code></td><td>String</td><td><p><strong>Specific to </strong><mark style="color:green;"><strong><code>people</code></strong></mark><strong> model</strong><br></p><p>Controls the zoom level applied to the focus framing. Accepted values:</p><ul><li><mark style="color:green;"><code>off</code></mark> : No zoom applied.</li><li><mark style="color:green;"><code>low</code></mark> : Slight zoom, keeping generous space around the framing.</li><li><mark style="color:green;"><code>medium</code></mark> : Moderate zoom, balanced framing around the target.</li><li><mark style="color:green;"><code>max</code></mark> : Maximum zoom, cropping as tightly as possible to the framing.</li></ul></td><td><code>max</code></td></tr><tr><td><code>focus_target</code></td><td>String</td><td><p><strong>Specific to </strong><mark style="color:green;"><strong><code>people</code></strong></mark><strong> model</strong><br></p><p>When multiple subjects are detected, defines which one the auto focus should target. Accepted values:</p><ul><li><mark style="color:green;"><code>largest</code></mark> : Focuses on the most prominent subject in the image (largest detected).</li><li><mark style="color:green;"><code>left</code></mark> : Focuses on the subject positioned furthest to the left.</li><li><mark style="color:green;"><code>middle</code></mark> : Focuses on the subject positioned in the center.</li><li><mark style="color:green;"><code>right</code></mark> : Focuses on the subject positioned furthest to the right.</li><li><mark style="color:green;"><code>all</code></mark> : Frames all detected subjects.</li></ul></td><td><code>all</code></td></tr></tbody></table>

### Model **generic**

* I&#x66;**`auto_focus`** is true , the model select all the detected objects by default wit&#x68;**`generic`**&#x6D;odel
* Th&#x65;**`focus_objects`** parameter uses object names from the [Open Images Dataset](https://developers.abyssale.com/annexes#open-image-object-labels). Refer to their documentation for the complete list of supported object names.

#### Examples:

```json
{
  "auto_focus": true,
  "auto_focus_properties": {
    "model": "generic",
    "focus_objects": [
      "Woman",
      "Pencil case",
      "Car"
    ]
  }
}
```

<table><thead><tr><th width="387">Payload</th><th>Result</th></tr></thead><tbody><tr><td>"auto_focus": false</td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FQ6H9W8pDplEcTZeJJ0eY%2Ffamily_new.jpeg?alt=media&#x26;token=1da306b4-4317-48bc-83b2-d0ecc53e4b1d" alt=""></td></tr><tr><td><p>"auto_focus": true</p><p>"auto_focus_properties": { "model": "generic" }</p></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FOZXmRNd9QvrAkOEHtq6S%2Ffamily_gen_focus.jpeg?alt=media&#x26;token=2f1a0d28-08ec-42a2-8c21-9aa00c4b259a" alt="" data-size="original"></td></tr><tr><td><p>"auto_focus": true</p><p>"auto_focus_properties": { "model": "face" }</p></td><td>                         <img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FEPjSJyGTYw6cpykBMTeu%2Ffamily_face_focus.jpeg?alt=media&#x26;token=53e0c235-1ada-4ce2-be97-102ec7977660" alt="" data-size="original"></td></tr><tr><td><p>"auto_focus": true</p><p>"auto_focus_properties":{ </p><p>       "model":"generic",</p><p>        "focus_objects": ["man"] </p><p> }</p></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FiHlvzRAgBOH57vOvWifg%2Ffamily_man_focus.jpeg?alt=media&#x26;token=9358c53b-e438-4783-be5c-d38c55be4625" alt="" data-size="original"></td></tr><tr><td><p>"auto_focus": true</p><p>"auto_focus_properties":{ </p><p>       "model":"generic",</p><p>        "focus_objects": ["woman"] </p><p> }</p></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fx68886dcHvU2qYPWswMu%2Ffamily_woman_focus.jpeg?alt=media&#x26;token=6218d89d-fd72-4060-aa54-f49bd568a83a" alt="" data-size="original"></td></tr><tr><td><p>"auto_focus": true</p><p>"auto_focus_properties":{ </p><p>       "model":"generic",</p><p>        "focus_objects": ["boy"] </p><p> }</p></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FRmVE21WdhJfYzHAMTuwG%2Ffamily_boy_focus.jpeg?alt=media&#x26;token=fecc719a-849a-4b00-b00f-8588722a4c4c" alt="" data-size="original"></td></tr><tr><td><p><br>"auto_focus": true</p><p>"auto_focus_properties":{ </p><p>       "model":"generic",</p><p>        "focus_objects":  ["woman", "boy" ] </p><p> }</p></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FpQeaVU4GaPaH5UR6IaYI%2Ffamily_woman_boy_focus.jpeg?alt=media&#x26;token=f93b1916-04c4-4dd5-bb17-5dcd05e94198" alt="" data-size="original"></td></tr></tbody></table>

### **Model people** <a href="#alignment" id="alignment"></a>

Auto focus applies exclusively to images dynamically set through the payload. Design images are intentionally excluded from this behavior to prevent unintended side effects.

#### Examples:

```json
{
  "auto_focus": true,
  "auto_focus_properties": {
    "model": "people",
    "focus_framing": "shoulders",
    "focus_zoom": "low",
    "focus_target": "right"
  }
}
```

<table><thead><tr><th>Payload</th><th width="374">Result</th></tr></thead><tbody><tr><td><pre><code>{
  "auto_focus": false
}
</code></pre></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FFqFiwwHmMqg8vQK16Cb2%2Fimage.png?alt=media&#x26;token=7d6a253e-cac1-48f0-9965-b9010aa138b1" alt="" data-size="original"></td></tr><tr><td><pre><code>{
  "auto_focus": true,
  "auto_focus_properties": {
    "model": "people",
    "focus_framing": "shoulders",
    "focus_zoom": "low",
    "focus_target": "right"
  }
}
</code></pre></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F7E89Ky8x8okkNRfJJ80m%2Fimage.png?alt=media&#x26;token=bcd844ab-55c1-43ce-96d0-ae567289dcd0" alt="" data-size="original"></td></tr><tr><td><pre><code>{
  "auto_focus": true,
  "auto_focus_properties": {
    "model": "people",
    "focus_framing": "shoulders",
    "focus_zoom": "low",
    "focus_target": "left"
  }
}
</code></pre></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FmX4MKYtVoL8zOEEmtTru%2Fimage.png?alt=media&#x26;token=86fd6d65-039d-4f0c-88b1-45dd7d90095f" alt="" data-size="original"></td></tr><tr><td><pre><code>{
  "auto_focus": true,
  "auto_focus_properties": {
    "model": "people",
    "focus_framing": "head",
    "focus_zoom": "max",
    "focus_target": "left"
  }
}
</code></pre></td><td><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FLG0Z5nzphVIfafgStWQd%2Fimage.png?alt=media&#x26;token=5f8186b2-bc05-4d96-8011-1fde289cdb65" alt="" data-size="original"></td></tr></tbody></table>

## Text to image <a href="#alignment" id="alignment"></a>

\
The text-to-image feature allows you to create custom images simply by typing a description of what you’d like to see. Essentially, your description acts exactly like a prompt: the more detail you provide, the more accurately the AI can bring your specific vision to life.

**It's only available for asynchronous generation.**&#x20;

*If the `image_url`  (except default image) or `image_encoded` is given, this property will be ignored.*

#### Examples:

```json
"text_to_image": "A sleek, modern glass villa situated in the middle of a minimalist lavender field. Sharp lines, reflection of the blue sky in the windows, wide-angle shot, architectural photography style, hyper-realistic."
```

#### Result:

<figure><img src="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FvT6LMT1dxQyE8iYQehBB%2Fimage.png?alt=media&#x26;token=91ab4904-dee4-4554-adf1-5da718b968a1" alt=""><figcaption></figcaption></figure>
