# HD Background Removal

Using HD Background Removal is recommended when you want to remove the background of a high-resolution image (≥ 2K) to get more detailed subject edges:

<figure><img src="/files/gEzw5cBrGmlGVRenlZTc" alt=""><figcaption></figcaption></figure>

To enable the feature, add this HTTP header to your API call: `pr-hd-background-removal: auto`

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

{% code overflow="wrap" %}

```bash
curl --location 'https://image-api.photoroom.com/v2/edit' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-hd-background-removal: auto' \
  --form imageFile=@/absolute/path/to/image.jpg \
  --form referenceBox=originalImage \
  --output result-hd-background-removal.png
```

{% endcode %}

<a href="https://try-api.photoroom.com/?pr-hd-background-removal=auto&#x26;referenceBox=originalImage" class="button primary">Try it now!</a>

Here are several examples of what HD Background Removal can achieve:

{% hint style="info" %}
Don't hesitate to download the images locally and zoom on the edges to better see the difference.
{% endhint %}

{% tabs %}
{% tab title="1" %}

<figure><img src="/files/hkCFplwa5guD1mLkuwlQ" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/uIM84XSQMPw8P8phCutd" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/4H5mvtcmDVHPrSrYOwzB" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="2" %}

<figure><img src="/files/60INc0KyXvudpKS8oxif" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/N2j44Pylc1CaZ3bO29zZ" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/VXbQUa6WX0Abbqb6gFAz" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="3" %}

<figure><img src="/files/B0GRySdtRXxWjGZ6Gxsi" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/CpZ7nMGyhyjcHjfbIiTP" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/bw6qd4VOrq9hIvZsH3Uq" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="4" %}

<figure><img src="/files/oX2lkYq67W3nlEDyTrvp" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/Izbuoh2DUeWtyUqfJfCM" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/WARskJBDK0q5MCAF8Xzn" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="5" %}

<figure><img src="/files/tVaBh4M51SUv13oBt68s" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/xNdqyB6RNqQVrUZXsp5U" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/NxBJIsWtSkO5eDwdkQcN" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="6" %}

<figure><img src="/files/smAp1uI3xmNY8nv7v9gy" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/AvBw3k8gGlQRsAysSM6j" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/y2dkDkTcCQSMNYbup0Mo" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="7" %}

<figure><img src="/files/t4zxtRkdj4LDm1jy1bqS" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/i6KZhiap48ccEwZSxl1l" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/l5u5oa5P9q4IxUpVgpX0" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="8" %}

<figure><img src="/files/MoiQ6eKenih7kmyEhG9X" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/uhSRYkhhiOGO3XF3t72d" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/aUj2frhBuiU6PfTYixN7" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="9" %}

<figure><img src="/files/8yQyRjeOUN7Wvf1sgeJS" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/QykXyjAfP468HrhnsuD4" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/B4TqNy6AwPLLMwWQ7ux6" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="10" %}

<figure><img src="/files/13g7yiz7cklZrTLZHqtT" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="/files/zg2nujEJhjZawWzZ5dvn" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="/files/vtZfevB0ktJ9vAxKsPw5" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.photoroom.com/image-editing-api-plus-plan/hd-background-removal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
