# How to create food delivery images with consistent brand guidelines

In this tutorial you will find the details of how the [Image Editing API](https://docs.photoroom.com/image-editing-api-plus-plan) enables you to edit food images so that their look-and-feel is consistent across your entire delivery app.

## Introduction

If you’re running a food delivery app, you know how important it is to have food images that follow the same brand guidelines, so that the look-and-feel is consistent from one image to the next.

But if you're getting your images from different restaurant owners, it's very likely that the images you receive have been taken at very different angles, with distracting backgrounds and sometimes without having the full dish in view:

<div data-full-width="false"><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBoEtpe4hhPXHhR0nOue1%2FFood_00001.jpeg?alt=media&#x26;token=e8f273c1-e1a0-4771-ad6c-28a68e24a6e0" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSiMAg7TeuLhwV605YidZ%2FFood_00002.jpeg?alt=media&#x26;token=7adf17c8-2ba2-4b7f-954b-01d28fdf9a67" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgGzgnqpfBwX40MkrOppA%2FFood_00003.jpeg?alt=media&#x26;token=0ee7a17d-de27-49c0-9510-4260ba863451" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwGuVhInxGXvs26yMoq4S%2FFood_00004.jpeg?alt=media&#x26;token=d2a50d3f-a870-4c3b-8e92-d48fbb91b272" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4lHW5MBsiC9GoYNIbsF0%2FFood_00005.jpeg?alt=media&#x26;token=19945b87-fbea-4f0c-9fdf-c2e9251d8b50" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJogG9vmxJ4D8HliDqBxG%2FFood_00006.jpeg?alt=media&#x26;token=77ee9c88-bfee-4213-8e6d-7d4cf6909623" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F50RpVrfYnQBxCoDvRIdE%2FFood_00007.jpeg?alt=media&#x26;token=3beda4ab-2d1b-4922-ae50-9dd97a3f2f83" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVzbanGPOclIbSNKHxbg5%2FFood_00008.jpeg?alt=media&#x26;token=2f1e4dee-90a1-452f-8cbb-4567f5ff3c0e" alt=""><figcaption></figcaption></figure></div>

However what you want is to have all your images follow the same brand guidelines, such as:

* 2000x2000 pixels
* white background
* dish is centered, with 10% of padding
* realistic shadow
* no cropped dish (including plates)

So let's go over how we can implement these guidelines using the [Image Editing API](https://docs.photoroom.com/image-editing-api-plus-plan).

## Implementation

### Output Size

Let's start by making sure that the result images all have the same resolution.

We can configure this resolution through the parameter `outputSize`, by setting its value to `2000x2000`.

### Centering + Padding

By default, the [Image Editing API](https://docs.photoroom.com/image-editing-api-plus-plan) will automatically center the dish in the result image.

But we also need to configure the [positionning of the dish](https://docs.photoroom.com/image-editing-api-plus-plan/positioning), so that there's 10% of padding between the dish and the edges of the result image.

For this, we'll set the parameter `padding` to the value `10%`.

### White Background

By default, the [Image Editing API](https://docs.photoroom.com/image-editing-api-plus-plan) will remove the background of the input image, so there's no need to set a specific argument for it to happen.

However, we do need to specify that we want to result image to be on a white background.

To achieve this, we'll use the parameter `background.color` which allows us to [replace the background with a solid color](https://docs.photoroom.com/image-editing-api-plus-plan/static-background#solid-color) and set its value to `white`.

### Realistic Shadow

Next we want to add a realistic shadow to the dish, so that it blends nicely with its new background.

The [Image Editing API](https://docs.photoroom.com/image-editing-api-plus-plan) offers a feature called [AI Shadows](https://docs.photoroom.com/image-editing-api-plus-plan/ai-shadows) that allows you to add a realistic shadow around the main subject of the input image.

To add an AI Shadow with a soft shadow preset to the dish, set the parameter `shadow.mode` to the value `ai.soft`.

{% hint style="info" %}
Additional shadow presets are available, more details can be found in the [documentation of AI Shadows](https://docs.photoroom.com/image-editing-api-plus-plan/ai-shadows).
{% endhint %}

### No Cropped Dish

Finally, we need to make sure that if the dish (or its plate) has been cropped in the original image, it is uncropped in the result image.

For this we'll use the feature [AI Uncrop](https://docs.photoroom.com/image-editing-api-plus-plan/ai-uncrop) of the [Image Editing API](https://docs.photoroom.com/image-editing-api-plus-plan).

To use uncrop the dish if needed, set the parameter `uncrop.mode` to the value `ai.auto`.

## API Call

Using the parameters `outputSize`, `background.color`, `padding`, `shadow.mode` and `uncrop.mode` we're now ready to automatically edit the product images to make them compliant with the brand guidelines.

Here's the API call we'll use:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form outputSize=2000x2000 \
  --form background.color=white \
  --form padding='10%' \
  --form shadow.mode=ai.soft \
  --form uncrop.mode=ai.auto \
  --output result.png
```

<a href="https://try-api.photoroom.com/?outputSize=2000x2000&#x26;background.color=white&#x26;padding=10%25&#x26;shadow.mode=ai.soft&#x26;uncrop.mode=ai.auto" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](https://docs.photoroom.com/getting-started/introduction#how-can-i-get-my-api-key).
{% endhint %}

## Results

Here's a before/after of the results this API call produces:

|                                                                                                     *(original image)*                                                                                                    |                                                                                                     *(edited image)*                                                                                                     |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBoEtpe4hhPXHhR0nOue1%2FFood_00001.jpeg?alt=media\&token=e8f273c1-e1a0-4771-ad6c-28a68e24a6e0) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fm1KwlLkeC4iYazmKBcMZ%2FFood_00001.png?alt=media\&token=2694089a-0aa1-498d-85e0-efb54ebfa883) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSiMAg7TeuLhwV605YidZ%2FFood_00002.jpeg?alt=media\&token=7adf17c8-2ba2-4b7f-954b-01d28fdf9a67) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVj7scTtbAq0kvm0bPblp%2FFood_00002.png?alt=media\&token=7ac38f38-9c9e-436f-a359-38f266dfb185) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgGzgnqpfBwX40MkrOppA%2FFood_00003.jpeg?alt=media\&token=0ee7a17d-de27-49c0-9510-4260ba863451) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FM1ccbrppflvxz70JZsVY%2FFood_00003.png?alt=media\&token=4ff723b1-36aa-40d8-808e-789005251a46) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwGuVhInxGXvs26yMoq4S%2FFood_00004.jpeg?alt=media\&token=d2a50d3f-a870-4c3b-8e92-d48fbb91b272) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEAHRhRHSrHMbRyoeNIjy%2FFood_00004.png?alt=media\&token=e3971233-1c22-43d3-89da-bbd42afed48a) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4lHW5MBsiC9GoYNIbsF0%2FFood_00005.jpeg?alt=media\&token=19945b87-fbea-4f0c-9fdf-c2e9251d8b50) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGgjafQ4PmjBD4c5KDPsH%2FFood_00005.png?alt=media\&token=e0d6e404-1d00-4f2f-9e6a-df07b3a4319b) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJogG9vmxJ4D8HliDqBxG%2FFood_00006.jpeg?alt=media\&token=77ee9c88-bfee-4213-8e6d-7d4cf6909623) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsJA6m4IrnfZv1hMXoSlZ%2FFood_00006.png?alt=media\&token=301693ea-3eec-4a3c-913b-db9be77e54e0) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F50RpVrfYnQBxCoDvRIdE%2FFood_00007.jpeg?alt=media\&token=3beda4ab-2d1b-4922-ae50-9dd97a3f2f83) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4fdXsnKjsWgzBQfE8D7k%2FFood_00007.png?alt=media\&token=4d4e3d50-c9f2-4430-a384-d86088014dea) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVzbanGPOclIbSNKHxbg5%2FFood_00008.jpeg?alt=media\&token=2f1e4dee-90a1-452f-8cbb-4567f5ff3c0e) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDvFWqj9sum4DTH3B1zsc%2FFood_00008.png?alt=media\&token=af2e427c-3463-4842-b9ec-0f892a35a485) |

## Conclusion

The [Image Editing API](https://docs.photoroom.com/image-editing-api-plus-plan) allows you to easily edit food images so that they become compliant with your brand guidelines, enabling you to have a consistent look-and-feel across your entire food delivery app.

If you want to learn more, here's the details of the API features used in this tutorial:

* [Output Size](https://docs.photoroom.com/image-editing-api-plus-plan/output-size)
* [Solid Color Background](https://docs.photoroom.com/image-editing-api-plus-plan/static-background#solid-color)
* [Positioning](https://docs.photoroom.com/image-editing-api-plus-plan/positioning)
* [AI Shadows](https://docs.photoroom.com/image-editing-api-plus-plan/ai-shadows)
* [AI Uncrop](https://docs.photoroom.com/image-editing-api-plus-plan/ai-uncrop)

## Book a demo

If you'd like more information about how the Photoroom API can help you improve the quality of your images, don't hesitate to [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>
