# Paint Visualizer

The paint\_visualizer endpoint allows you to transform the look and feel of your interiors and exteriors with our Paint Visualizer tool. This feature enables you to effortlessly change the paint color of any wall, whether interior or exterior, using either our preset options or colors you upload.

You can select areas to paint using Automated Selection or Manual Selection. Choose colors from our Presets OR use the color picker OR upload an image with your sample color. \
\
For the best results, ensure your selection is as accurate as possible.

## ENDPOINT&#x20;

<mark style="color:green;">**`POST`**</mark>  <mark style="color:purple;">**`/paint_visualizer`**</mark>

An API URL would be like <mark style="color:blue;"><https://homedesigns.ai/api/v2/paint\\_visualizer></mark>

{% hint style="info" %} <mark style="color:blue;">The paint\_visualizer endpoint lets you easily change the paint color of any wall using preset options or custom colors.</mark>
{% endhint %}

{% tabs %}
{% tab title="Request" %}
{% hint style="info" %} <mark style="color:blue;">An API request must be in the</mark> <mark style="color:orange;">**`form-data`**</mark> <mark style="color:blue;">format.</mark>
{% endhint %}

### Request

<table><thead><tr><th width="232">Parameters &#x26; Data Type</th><th width="181">Value</th><th>Description</th></tr></thead><tbody><tr><td><p><mark style="color:red;"><strong><code>image</code></strong></mark>  </p><p>file[ .jpg, .jpeg, .png] / base64 Image <mark style="color:green;"><code>string</code></mark></p></td><td>-</td><td>The image to be processed by the API. The image dimensions must be 512x512 pixels or greater for optimal results. <strong>(Required Parameter)</strong></td></tr><tr><td><mark style="color:red;"><strong><code>masked_image</code></strong></mark><br>file[ .jpg, .jpeg, .png] / base64 Image <mark style="color:green;"><code>string</code></mark></td><td>-</td><td>The image to be processed by the API. The image dimensions must be 512x512 pixels or greater for optimal results. <a href="https://homedesigns.ai/get-mask-image">Click Here</a> to generate a mask image <a href="https://youtu.be/2wmHz2ze0t4">Video Tutorial.</a> <strong>(Required Parameter)</strong></td></tr><tr><td><p><mark style="color:red;"><strong><code>no_design</code></strong></mark> </p><p><mark style="color:green;"><code>integer</code></mark></p></td><td>Min - 1, Max - 4</td><td>Specifies the number of design variations you want the API to generate. The minimum is 1 and the maximum is 4. <strong>(Required Parameter)</strong></td></tr><tr><td><p><mark style="color:red;"><strong><code>color_image</code></strong></mark></p><p>file[ .jpg, .jpeg, .png] / base64 Image <mark style="color:green;"><code>string</code></mark></p></td><td>Color Image should be as per your choice</td><td><p>The image to be processed by the API. </p><p><em><mark style="color:red;">(Required if rgb_color is not available).</mark></em></p></td></tr><tr><td><mark style="color:red;"><strong><code>rgb_color</code></strong></mark><br>RGB Color <mark style="color:green;"><code>string</code></mark> code with ',' comma seperated value. Example: '183,42,42'</td><td>RGB color should be as per RGB color code</td><td><p>An rgb_color value is specified with: rgb( RED , GREEN , BLUE ). Each parameter defines the intensity of the color as an integer between 0 and 255. For example, rgb(0,0,255) is rendered as blue, because the blue parameter is set to its highest value (255) and the others are set to 0. <a href="https://g.co/kgs/qwffNXo">Click Here</a> to choose the color code. </p><p><em><mark style="color:red;">(Required if color_image is not available)</mark></em></p></td></tr></tbody></table>
{% endtab %}

{% tab title="Errors" %}

### Parameters & Errors

<mark style="color:red;">**`image`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>Image field required</td><td>Image not provided</td></tr><tr><td>Invalid image size. The image width and height must be 512x512 or greater than 512x512 pixels.</td><td>Image Size Not Proper.</td></tr><tr><td>Invalid image format. Only PNG, JPEG and JPG images are allowed.</td><td>Image Format not valid.</td></tr></tbody></table>

<mark style="color:red;">**`masked_image`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>masked_image field required</td><td>masked_image not provided</td></tr><tr><td>Invalid image size. The image width and height must be 512x512 or greater than 512x512 pixels.</td><td>masked_image Size must be greater than 512x512.</td></tr><tr><td>Invalid image format. Only PNG, JPEG and JPG images are allowed.</td><td>masked_image Format not valid.</td></tr></tbody></table>

<mark style="color:red;">**`no_design`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>no_design field required</td><td>no_design not provided</td></tr><tr><td>no_design value is not a valid enumeration member; permitted: 1, 2, 3, 4</td><td>no_design not provided properly</td></tr></tbody></table>

<mark style="color:red;">**`color_image`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>The color_image is required when rgb_color is not provided.</td><td>whether the color_image or rgb_color field is required to get the results.</td></tr><tr><td>The color image field must be an image.</td><td>color_image value is not an image.</td></tr><tr><td>The color image field must be a file of type: jpeg, png, jpg</td><td>The image format is not supported for the color_image.</td></tr></tbody></table>

<mark style="color:red;">**`rgb_color`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>The rgb_color is required when color_image is not provided.</td><td>whether the rgb_color or color_image field is required to get the results.</td></tr><tr><td>The rgb_color field format is invalid. Example: '183,42,42'</td><td>rgb_color value is not in proper format.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response" %}

<pre class="language-json"><code class="lang-json"><strong>
</strong><strong>//Output should be in list of array depends on no of designs as shown below:
</strong>
{
    "input_image": "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/input-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-2024-05-30-11-08-30.png",
    "output_images": [
            "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-1.png",
            "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-2.png",
            "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-2.png"
    ]
}



</code></pre>

{% endtab %}
{% endtabs %}
