# Car dealer photo

Let's say we want to create attractive car photo. We have plain car photos:

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FbqLGDMB41ENKfHP0tfpK%2F20241121_111223.jpg?alt=media&#x26;token=cb32440e-638d-4eee-a1d6-8efc48e80e39" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FESEKAOEIjWdjyPPnGwcn%2F20230315_101335.jpg?alt=media&#x26;token=c1268fe1-c462-470c-95f2-7156e2b1f1d3" alt=""><figcaption></figcaption></figure>

and the backdrops:

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FTD5MqNcRSaYfxbsbOsiG%2Fauto-backdrop.jpg?alt=media&#x26;token=13bcfc9f-136b-4320-83f2-a3af5b3463b4" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2Fj3fvjWNZlKI5fPsYwkp3%2Fauto-backdrop2.jpg?alt=media&#x26;token=7b39a063-4be3-49c6-b62f-c40844004b18" alt=""><figcaption></figcaption></figure>

#### Image Blending Techniques

When it comes to integrating a product image with various backdrops, two primary image blending techniques can be employed:

1. **Fully Generative**:

   * This technique allows for the generation of entirely new visuals by seamlessly integrating the product with the chosen backdrop. It can also amend or alter the product image itself, ensuring that it aesthetically aligns with the overall composition. Fully generative blending is particularly useful for creative and flexible visual storytelling where customization and independence from the original image are desired.

2. **Plain Blending**

   This type of blending preserves item/product but can have problems with perspective. By not changing item/product it also will not remove uncecessary reflections, dirt, etc.

Each method offers distinct advantages, depending on whether the emphasis is on creative freedom or product fidelity.

### Example of fully generative blending

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FUCGIwiBsG1xiajK3qcbu%2Fgitbook1.jpg?alt=media&#x26;token=b3a3d42e-1287-4b4b-be22-8a41c9f06436" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FsS9D4MP83WA1i4pE6Qe6%2Fgitbook2.jpg?alt=media&#x26;token=e423e345-19ba-40ae-b3dc-05aaf8f26f9a" alt=""><figcaption></figcaption></figure>

```json
{
  "background": {
    "generate": {
      "description": "place the car in place from second photo, car dealer photo",
      "model_type": "gemini-3-pro-image-preview",
      "adapter_type": "img2img",
      "context_images": [
        "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/gitbook1.jpg",
        "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/gitbook2.jpg"
      ]
    }
  },
  "width": 1344,
  "height": 768
}
```

and the result is:

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FZo3sJFZP9YrnFH1Hrr18%2Fimage.png?alt=media&#x26;token=082aeb68-0e12-40d3-95d1-61c401599794" alt=""><figcaption></figcaption></figure>

### Example of plain blending

```json
{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/20230315_101335.jpg",
    "background": {
        "generate": {
            "description": "item positioned on plain white background, diffused reflections",
            "item_area_percentage": 0.65,
            "position": "MB",
            "background_url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/auto-backdrop2.jpg"
        }
    }
}
```

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2F234CCK5OjBFU3iiNfdU6%2F20230315_101335-width%3D1600_height%3D1201_face_generated%20(1).jpg?alt=media&#x26;token=7ab3aa72-966e-4398-8b6f-c228b19a5f79" alt=""><figcaption></figcaption></figure>

| Parameter              | Description                                                                                                                                                                                                                                                      |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| item\_area\_percentage | Float value from 0.3 to 1.0 describing how much the item  will be rescaled.                                                                                                                                                                                      |
| position               | <p>Possible values</p><ul><li>LT - left top</li><li>MT - middle top</li><li>RT - right top</li><li>LM - left middle</li><li>MM - middle middle</li><li>RM - right middle</li><li>LB - left bottom</li><li>MB - middle bottom</li><li>RB - right bottom</li></ul> |
| background\_url        | Url to backdrop image                                                                                                                                                                                                                                            |

Additional hints:

* To create a realistic effect, ensure the object's perspective matches the background. Otherwise, the effect may appear unrealistic.
* The prompt description needs to similar to: "item positioned on plain white background, diffuse reflections", otherwise blend of generated background and the backdrop will be unrealistic.
* Generated image will have resolution of the given backgrop
