# AI Shadows

The Image Editing API allows you to add realistic shadows to the main subject of the input image.

Here's an example of how you can use AI Shadows to post-process product images at scale:

{% embed url="<https://www.youtube.com/watch?v=wQo44FMrV2k>" %}

To add a realistic shadow, set the argument `shadow.mode` with one of the following values:

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><em>(original image)</em></td><td align="center"><code>shadow.mode=ai.soft</code></td><td align="center"><code>shadow.mode=ai.hard</code></td><td align="center"><code>shadow.mode=ai.floating</code></td></tr><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FezcI1WOGh9wTAcBx6lac%2Fimage-cache.jpeg?alt=media&#x26;token=19c3eb70-8ab5-48bd-a5fa-67a59c5dd3f9" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYcLPBX7379VU9cqL0wdS%2Fsoft-shadow.png?alt=media&#x26;token=c4fe635e-6f5a-4653-8eb5-470153e9f123" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fg7Q1tzFxRr4XKklO2N1B%2Fhard-shadows.png?alt=media&#x26;token=b72c27f6-e9ef-48cc-b5e6-524cdf3b3f8e" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FafzNuWvuppwNElFBBHZJ%2Ffloating-shadows.png?alt=media&#x26;token=395432af-6c2b-44a4-8120-3e31480b1bd9" alt=""></td></tr></tbody></table>

{% hint style="warning" %}
If you've also added an [AI Background](https://docs.photoroom.com/image-editing-api-plus-plan/ai-backgrounds) to your image, then it's **not** recommended to also add an AI Shadow as the generated background will already include a shadow for the subject.
{% endhint %}

If you want to give it a try, here's the code to reproduce the examples above:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1000x1000 \
  --form padding=0.1 \
  --form shadow.mode=ai.soft \
  --output with-realistic-shadow.png
```

{% endcode %}

<a href="https://try-api.photoroom.com/?background.color=FFFFFF&#x26;outputSize=1000x1000&#x26;padding=0.1&#x26;shadow.mode=ai.soft" class="button primary">Try it now!</a>
