# Palette API & No-code Tools

Integrate Palette with your favorite apps or use our API to build your own tools

* **Bulk Colorization**: Directly apply Palette to your Google Drive or Dropbox files for mass colorization of your family memories.
* **App Development**: Construct a colorization app from scratch or integrate Palette into your current application for enhanced features.
* **Video Integration (Developer)**: Use the Video API to colorize video frames in SD, Full-HD, or 4K resolution, at an affordable price.
* **Simple Video Colorization**: You can now try [Palette's Video Coloriztion](https://neural.love/video-colorization?via=1n2cp) via our partner Nerual Love. Easy to use and no technical knowledge needed.&#x20;
* **New: Windows Desktop Application:** Streamline your professional workflow with [Covenant's desktop app for Windows](https://covenant.software/getting-started/), using the Palette Colorization engine.

## **API & Developer Tools**

**Note: The API platform has changed to** [**RapidAPI**](https://rapidapi.com/palette-app-palette-app-default/api/colorize-photo1/pricing)

{% embed url="<https://www.loom.com/share/642b149d76154460a77839ab9fb0b976?sid=72e8b65f-2025-4e83-9d39-9d582e627a03>" %}

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><strong>Bulk Processing</strong></td><td>Via Google Colab</td><td><a href="/files/5T7G6vSaNmw57r9ium7a">/files/5T7G6vSaNmw57r9ium7a</a></td><td><a href="/pages/9Ss8XUBv3Hj5lU80O6Kz">/pages/9Ss8XUBv3Hj5lU80O6Kz</a></td></tr><tr><td></td><td><strong>Settings Visualized</strong></td><td></td><td><a href="/files/tV5Mhma46jU7a0zKqMhU">/files/tV5Mhma46jU7a0zKqMhU</a></td><td><a href="/pages/p34dOt88AHtxdEtjAEjb">/pages/p34dOt88AHtxdEtjAEjb</a></td></tr></tbody></table>

## **2. Video Colorization**

**Note: The API platform has changed to** [**RapidAPI**](https://rapidapi.com/palette-app-palette-app-default/api/colorize-video/pricing)

{% embed url="<https://www.loom.com/share/2d7337051d5d4051aafbc005b04ffa83?sid=bce6d6b8-1b7e-4dc7-9517-6a2790766106>" %}

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><p><strong>Video Colorizer</strong></p><p>Via Google Colab</p></td><td></td><td><a href="/files/6hOXbFy2uQTNA8nPK3vg">/files/6hOXbFy2uQTNA8nPK3vg</a></td><td><a href="/pages/Dx9X1AQzNRhmaFUjBRrd">/pages/Dx9X1AQzNRhmaFUjBRrd</a></td></tr></tbody></table>

## **6. Getting Started**

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><strong>Key Features</strong></td><td>Everything you need to know about formats etc</td><td><a href="/files/n58MTUXJxwuJsAraoZac">/files/n58MTUXJxwuJsAraoZac</a></td><td><a href="https://platform.palette.fm/home">https://platform.palette.fm/home</a></td></tr><tr><td></td><td><strong>Subscription Plans</strong></td><td>Compare plans and find the best one your you</td><td><a href="/files/sQRtRJ5rU3RyPIDByPIw">/files/sQRtRJ5rU3RyPIDByPIw</a></td><td><a href="/pages/lJCWiUNs5d0X2copL0nI">/pages/lJCWiUNs5d0X2copL0nI</a></td></tr><tr><td></td><td><strong>Sign Up and Select a Plan</strong></td><td>Everything you need to know about formats etc</td><td><a href="/files/dcoa9R21600RPtaSf7rJ">/files/dcoa9R21600RPtaSf7rJ</a></td><td><a href="/pages/zrCEgZKJMKyF6TbeiWLV">/pages/zrCEgZKJMKyF6TbeiWLV</a></td></tr></tbody></table>

<table data-view="cards"><thead><tr><th></th><th data-hidden></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Key Features</strong></mark></td><td></td><td></td><td><a href="/pages/zrCEgZKJMKyF6TbeiWLV">/pages/zrCEgZKJMKyF6TbeiWLV</a></td></tr><tr><td><mark style="color:blue;"><strong>Subscripiton Plans</strong></mark></td><td></td><td></td><td><a href="/pages/lJCWiUNs5d0X2copL0nI">/pages/lJCWiUNs5d0X2copL0nI</a></td></tr><tr><td><mark style="color:blue;"><strong>First Request</strong></mark> </td><td></td><td></td><td><a href="/pages/aUQKBUki183oJy1vel2e">/pages/aUQKBUki183oJy1vel2e</a></td></tr><tr><td><mark style="color:blue;"><strong>Settings Visualized</strong></mark></td><td></td><td></td><td><a href="/pages/p34dOt88AHtxdEtjAEjb">/pages/p34dOt88AHtxdEtjAEjb</a></td></tr><tr><td><mark style="color:blue;"><strong>Image Python Snippets</strong></mark></td><td></td><td></td><td><a href="/pages/QPyJ9h2wbRnmNz0ooeDe">/pages/QPyJ9h2wbRnmNz0ooeDe</a></td></tr><tr><td><mark style="color:blue;"><strong>Video Python Snippets</strong></mark></td><td></td><td></td><td><a href="/pages/LfaFeg24g0SLiMx0E3b6">/pages/LfaFeg24g0SLiMx0E3b6</a></td></tr></tbody></table>


# Key features

Seamlessly incorporate Palette's colorization engine into your app or workflow

**Bulk Colorization**: With a simple script, colorize over 1 million images per day. This is ideal for large archives or professional colorists managing extensive projects.

**Video Integration (Beta)**: The Video API enables you to affordably colorize SD, Full-HD, or 4K video frames. Major production companies and TV channels around the world are already leveraging Palette.

**App Integration**: Integrate Palette directly into your iPhone photos, Google Drive, or your favorite photo app. Use the API to develop a new app or enhance an existing product with our powerful feature set.

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

**Image resolution:** up to 4K for both images and video frames.

**Image file size**: max 10MB per image

**Supported image formats**: .blp, .bmp, .dib, .cur, .pcx, .dcx, .dds, .fit, .fits, .ftc, .ftu, .gbr, .gif, .grib, .h5, .hdf, .png, .apng, .icns, .ico, .im, .iim, .tif, .tiff, .jfif, .jpe, .jpg, .jpeg, .jp2, .j2k, .jpc, .jpf, .jpx, .j2c, .mpo, .msp, .palm, .pcd, .pxr, .pbm, .pgm, .ppm, .pnm, .psd, .bw, .rgb, .rgba, .sgi, .ras, .tga, .icb, .vda, .vst, .webp, .wmf, .emf, .xbm, .xpm, .avif, .avifs, .heic, .heics, .heif, .heifs, .hif

**Colorization guidence**: choose from automated prompts, create custom prompts, or use reference images for colorization

**Extra tuning**: basic support for auto color correction, white balancing, color temperature, and saturation.

**Prompt generator**: automatically generate up to 120 prompts for testing various colorizations on a single image

**Temporal coherence:** while the algorithm isn't specifically designed for video frame consistency, you can use a previous frame as a reference image and apply the same text prompt to shorter scenes for improved coherence


# The AI colorization engine

Palette introduces a new generation in AI colorization technology

We believe Palette is unique because:

* It is trusted by professional colorists at many of the largest production companies
* It offers simple and deep customization options
* It takes a fraction of a second to colorize each image (100-300ms)
* It uses a proprietary algorithm developed by a former Google resident
* It is known for producing dynamic skin tones, vibrant colors, and accurately handling details

But don't take our word for it, [read what people are saying](https://testimonial.to/palette/all) or watch Unmesh Dinda who run's one of the world's most popular Photoshop YouTube channels. Below is a comparison of the best AI colorizers.

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

Below is a quick comparison between the first generation of AI technology compared to Palette's second generation colorizer.&#x20;

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


# Subscription plans

An overview of your different options

Note: [**Register to the Palette Photo API here.**](https://rapidapi.com/palette-app-palette-app-default/api/colorize-photo1)

**Image credits:**&#x20;

* 1 Credit for 1 Watermarked SD image
* 1 Credit for one call to the prompt API
* 10 Credits per SD image
* 15 Credits per Full-HD image
* 20 Credits per 4K image

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

## Image Pricing overview

Overview feature comparison&#x20;

<table><thead><tr><th width="154">Plan</th><th width="158.33333333333331">Image Credits</th><th width="165">$/extra credits</th><th>QPS</th><th>Price</th></tr></thead><tbody><tr><td>Basic</td><td>200</td><td>$0.01</td><td>1</td><td>Free</td></tr><tr><td>Pro</td><td>8,000</td><td>$0.005</td><td>2.5</td><td>$39</td></tr><tr><td>Ultra</td><td>20,000</td><td>$0.004</td><td>3.3</td><td>$79</td></tr><tr><td>Mega</td><td>48,000</td><td>$0.0035</td><td>5</td><td>$169</td></tr></tbody></table>

Costs per image in dollar

<table><thead><tr><th width="149">Plan</th><th>Watermarked SD</th><th width="105">SD</th><th width="119">Full-HD</th><th>4K</th></tr></thead><tbody><tr><td>Basic</td><td>$0.01</td><td>$0.1</td><td>$0.15</td><td>$0.2</td></tr><tr><td>Pro</td><td>$0.005</td><td>$0.05</td><td>$0.075</td><td>$0.1 </td></tr><tr><td>Ultra</td><td>$0.004</td><td>$0.04</td><td>$0.06</td><td>$0.08</td></tr><tr><td>Mega</td><td>$0.0035</td><td>$0.035</td><td> $0.053</td><td> $0.07</td></tr></tbody></table>

You can combine say SD and 4K downloads, but if you download all in one format, here is how many you get for each plan.

<table><thead><tr><th width="205">Plan</th><th width="164">Watermarked SD</th><th width="131">or SD</th><th width="134">or Full-HD</th><th>or 4K</th></tr></thead><tbody><tr><td>Basic</td><td>200</td><td>20</td><td>15</td><td>10</td></tr><tr><td>Pro</td><td>8,000</td><td>800</td><td>600</td><td>400</td></tr><tr><td>Ultra</td><td>20,000</td><td>2000</td><td>1500</td><td>1000</td></tr><tr><td>Mega</td><td>48,000</td><td>4800</td><td>3600</td><td>2400</td></tr></tbody></table>

### Image Size

1. SD: 640x480
2. Full-HD: 1920x1080
3. 4K: 3840x2160

Note: the aspect ratio can be different, it only limits the total amount of pixels, for example 4K can be 3840x2160 or 2160x3840.

## Endpoints

**Image Endpoints:**

1. \[POST] /colorize\_image\_with\_auto\_prompt
2. \[POST] /colorize\_image\_with\_auto\_prompt\_base64
3. \[POST] /colorize\_image\_with\_reference\_image
4. \[POST] /generate\_image\_prompt

The Image Colorization API includes four endpoints, while the Video Colorization API provides three. An additional endpoint is available in the Image API to facilitate easier integration with apps. The /colorize\_image\_with\_auto\_prompt\_base64 endpoint returns the image in base64 format, making it simple to display the result on the client side. Additionally, a caption field is returned if you wish to utilize the prompt that generated the colorization.

In the Image API, an automatic prompt and image can be generated simultaneously. However, with the Video API, you must first generate the prompt, and then use the prompt and image to create the colorized result. The Video API is designed to reuse prompts and reference images, reducing server load.


# Bulk Processing with Google Colab and Google Drive

Note: the demo is using the old API platform, there is the [new API on RapidAPI](https://rapidapi.com/palette-app-palette-app-default/api/colorize-photo1)

{% embed url="<https://www.loom.com/share/38fd5dcd03c74426ac7383c501b8d382?sid=d1a3a331-a7cb-4c50-a3f5-eb070fd511ae>" %}

{% embed url="<https://colab.research.google.com/drive/1OSjyd8ghcO1Rx1iRQKjJiQEZzd0EM754?usp=sharing>" %}


# API Demo Usage with Google Colab

Note: the demo is using the old API platform, there is the [new API on RapidAPI](https://rapidapi.com/palette-app-palette-app-default/api/colorize-photo1)

{% embed url="<https://colab.research.google.com/drive/10JZyVGUtru-wP5udk7MrRrHNCks9qAsT?usp=sharing>" %}


# Image python snippets

Snippets to get up and running

## Simple snippet to colorize one image with defaults

```python
import requests
# 1. X_RapidAPI_Host
# 2. X_RapidAPI_Key

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fjsn72323' 
X_RapidAPI_Host = 'colorize-photo1.p.rapidapi.com'

headers = {
        "X-RapidAPI-Key": X_RapidAPI_Key,
        "X-RapidAPI-Host": X_RapidAPI_Host
}

url = "https://" + X_RapidAPI_Host + /colorize_image_with_auto_prompt"
files = {'image': ('black_and_white.jpg', open(' ./black_and_white.jpg', 'rb'), 'image/jpeg' )}

response = requests.post(url, files=files, headers=headers)
f = open( 'colorized_image.jpg', 'wb' )
f.write(response.content)
f.close()
```

## Same snippet with the defaults explained and shown

```python
import requests

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fjsn72323' 
X_RapidAPI_Host = 'colorize-photo1.p.rapidapi.com'

headers = {
        "X-RapidAPI-Key": X_RapidAPI_Key,
        "X-RapidAPI-Host": X_RapidAPI_Host
}

url = "https://" + X_RapidAPI_Host +/colorize_image_with_auto_prompt"
files = {
    'image': ('black_and_white.jpg', open(' ./black_and_white.jpg', 'rb'), 'image/jpeg' )
}
data = {
    "resolution": "watermarked-sd", # watermarked-sd, sd, full-hd, or 4k
    "prompt": "", # replace with custom prompt
    "standard_filter_id": "1", # 1-20 default filters
    "artistic_filter_id": "O", # 1-100 more creative filters
    "raw_captions": "false", # true or false, remove post and prefix from promot
    "pre_fix": "", # create your own pre_fix, e.g. A photo of
    "post_fix": "", # create your own pre_fix, e.g. HDR and colorful.
    "auto_color": "true", # true or false, color balancing
    "white_balance": "false", # white balancing
    "temperature": "-0.1", # 0.0 - 1.0, cold or warm filter
    "saturation": "1.1" # 0.0 - 2.0, adjust saturation
}

response = requests.post(url, files=files, data=data, headers=headers)
f = open( 'colorized_image.jpg', 'wb' )
f.write(response.content)
f.close()
```

## Automatically colorize one image and return it in a Base64 string and print the caption

```python
import requests
import base64

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fjsn72323' 
X_RapidAPI_Host = 'colorize-photo1.p.rapidapi.com'

headers = {
        "X-RapidAPI-Key": X_RapidAPI_Key,
        "X-RapidAPI-Host": X_RapidAPI_Host
}

url = "https://" + X_RapidAPI_Host + "/colorize_image_with_auto_prompt_base64"
files = {
    'image': ('black_and_white.jpg', open(' ./black_and_white.jpg', 'rb'), 'image/jpeg' )
}
data = {
    "resolution": "watermarked-sd", # watermarked-sd, sd, full-hd, or 4k
    "prompt": "", # replace with custom prompt
    "standard_filter_id": "1", # 1-20 default filters
    "artistic_filter_id": "O", # 1-100 more creative filters
    "raw_captions": "false", # true or false, remove post and prefix from promot
    "pre_fix": "", # create your own pre_fix, e.g. A photo of
    "post fix": "", # create your own pre_fix, e.g. HDR and colorful.
    "auto_color": "true", # true or false, color balancing
    "white_balance": "false", # white balancing
    "temperature": "-0.1", # 0.0 - 1.0, cold or warm filter
    "saturation": "1.1" # 0.0 - 2.0, adjust saturation
}

response = requests .post(url, files=files, data=data, headers=headers)
# Check if the request was successful
if response.status_code == 200:
    # Get the response content in JSON format
    response_json = response.json()

    # Extract the image and caption values
    image_base64 = response_json["image"]
    caption = response_json["caption"]

    # Save the image into a file
    with open("colorized_image.jpg", "wb") as f:
        f.write(base64.b64decode(image_base64))

    # Print the caption
    print(caption)
else:
    print(f"Request failed with status code: {response.status_code}")
```

## Use a folder of reference images to colorize one image

```python
import os
import time
import requests
from PIL import Image

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fjsn72323' 
X_RapidAPI_Host = 'colorize-photo1.p.rapidapi.com'

HEADERS = {
        "X-RapidAPI-Key": X_RapidAPI_Key,
        "X-RapidAPI-Host": X_RapidAPI_Host
}

FOLDER_PATH = "test_images"  # Replace with the path to your folder
URL = "https://" + X_RapidAPI_Host + "/colorize_image_with_reference_image"


def main():
    i = 0
    for filename in os.listdir(FOLDER_PATH):
        if filename.endswith((".jpg", ".jpeg", ".png")):
            process_image(filename)
            i += 1
            time.sleep(0.5)

def process_image(filename):
    image_path = os.path.join(FOLDER_PATH, filename)
    files = {
        'image': ('black_and_white.jpeg', open('./black_and_white.jpeg', 'rb'), 'image/jpeg'),
        'image_ref': (filename, open(image_path, 'rb'), 'image/jpeg')
    }
    data = {
        "resolution": "4k",
        "auto_color": "false",
        "white_balance": "false",
        "temperature": "0.0",
        "saturation": "1.2"
    }
    response = requests.post(URL, files=files, data=data, headers=HEADERS)
    save_response_content(response, 'colorized_' + filename)

def save_response_content(response, output_filename):
    with open(output_filename, 'wb') as f:
        f.write(response.content)

if __name__ == "__main__":
    main()
```

## Colorize several BW frames with one reference image

```python
import os
import time
import requests
from PIL import Image

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fjsn72323' 
X_RapidAPI_Host = 'colorize-photo1.p.rapidapi.com'

HEADERS = {
        "X-RapidAPI-Key": X_RapidAPI_Key,
        "X-RapidAPI-Host": X_RapidAPI_Host
}

# Folder Paths
REFERENCE_IMAGE_FOLDER = "reference_image_folder"
BW_IMAGES_FOLDER = "bw_images_folder"
OUTPUT_FOLDER = "output_folder"

URL = "https://" + X_RapidAPI_Host + "/colorize_image_with_reference_image"


def main():
    i = 0
    reference_image_path = get_reference_image_path()
    
    for filename in os.listdir(BW_IMAGES_FOLDER):
        if filename.endswith((".jpg", ".jpeg", ".png")):
            process_image(filename, reference_image_path)
            i += 1
            time.sleep(0.5)

def get_reference_image_path():
    for filename in os.listdir(REFERENCE_IMAGE_FOLDER):
        if filename.endswith((".jpg", ".jpeg", ".png")):
            return os.path.join(REFERENCE_IMAGE_FOLDER, filename)
    return None

def process_image(filename, reference_image_path):
    bw_image_path = os.path.join(BW_IMAGES_FOLDER, filename)
    output_image_path = os.path.join(OUTPUT_FOLDER, 'colorized_' + filename)

    files = {
        'image': (filename, open(bw_image_path, 'rb'), 'image/jpeg'),
        'image_ref': ('reference.jpg', open(reference_image_path, 'rb'), 'image/jpeg')
    }
    
    data = {
        "resolution": "4k",
        "auto_color": "false",
        "white_balance": "false",
        "temperature": "0.0",
        "saturation": "1.2"
    }

    response = requests.post(URL, files=files, data=data, headers=HEADERS)
    save_response_content(response, output_image_path)

def save_response_content(response, output_filename):
    with open(output_filename, 'wb') as f:
        f.write(response.content)

if __name__ == "__main__":
    main()
```

## Generate 20 Prompts

```python
import requests
import json

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fjsn72323' 
X_RapidAPI_Host = 'colorize-photo1.p.rapidapi.com'

headers = = {
        "X-RapidAPI-Key": X_RapidAPI_Key,
        "X-RapidAPI-Host": X_RapidAPI_Host
}

url = "https://" + X_RapidAPI_Host + "/generate_image_prompt"

files = {
    'image': ('test.jpg', open('./test.jpg', 'rb'), 'image/jpeg')   
}

data = {
  "standard_filter_id": "0", # 1-20, 0 is disabled 
  "artistic_filter_id": "0", # 1-100, 0 is disabled
  "all_standard_filters": "true", # return all 20 prompts
  "all_artistic_filters": "false", # return all 100 prompts
  "raw_captions": "false" # remove pre and post fix to the caption
}

response = requests.post(url, files=files, data=data, headers=headers)
prompts = data = json.loads(response.text)
```


# Settings visualized

Visulize the settings for the main parameters

### Default Values for the Official Palette App

The new default values for [Palette](https://palette.fm/) are listed below, along with detailed explanations in the following sections:

```python
data = {
    "resolution": "watermarked-sd", # watermarked-sd, sd, full-hd, or 4k
    "prompt": "", # replace with custom prompt (manual prompt)
    "standard_filter_id": "1", # 0-20 default filters (auto prompt)
    "artistic_filter_id": "O", # 0-100 more creative filters (auto prompt)
    "raw_captions": "false", # true or false, remove post and prefix from prompt
    "pre_fix": "", # create your own pre_fix, e.g. A photo of
    "post_fix": "", # create your own pre_fix, e.g. HDR and colorful.
    "auto_color": "true", # true or false, color balancing
    "white_balance": "false", # white balancing
    "temperature": "-0.1", # 0.0 - 1.0, cold or warm filter
    "saturation": "1.1" # 0.0 - 2.0, adjust saturation
}
```

### Utilizing Standard Filters 1-20

* Parameter: *standard\_filter\_id*
* Enabled values: 1-20
* Disable value: 0
* 10 filters per row (e.g., first row: 1-10)&#x20;

{% hint style="info" %}
Filters 1-3 offer the most conservative colorizations, making them suitable defaults for various applications. Filter 1 is the most consistent choice. Filters 4-20 provide more vibrant colors but may be less robust. These 20 filters are the default options in the official Palette.fm.
{% endhint %}

<figure><img src="/files/1gUdkkGAGnsRZA7y1ApW" alt=""><figcaption></figcaption></figure>

### Utilizing Artistic Filters 1-100

* Parameter: *artistic\_filter\_id*
* Enabled values: 1-100
* Disable value: 0
* 10 filters per row (e.g., first row: 1-10)&#x20;

{% hint style="info" %}
These filters may be less consistent, but they offer more colorful results. They are featured in the "Surprise Me" option within the official Palette.fm browser-app.
{% endhint %}

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

### Auto Color Balancing

* Parameter: *auto\_color*
* Enabled value: true
* Disable value: false
* Example: Standard filters 1-20 with alternating auto\_color false and true. 10 per row.

{% hint style="info" %}
Comparisons are made in pairs. The first image has auto\_color set to false, while the second has it enabled. In Palette's official app, auto\_color is set to true by default. This setting enhances color balance, brings out softer colors, and adds a more vibrant appearance.
{% endhint %}

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

### Auto White Balancing

* Parameter: *white\_balance*
* Enabled value: true
* Disable value: false
* Example: Standard filters 1-20 with alternating *white\_balance* false and true. 10 per row.

{% hint style="info" %}
**Note**: Comparisons are presented in pairs. The first image has white\_balance set to false, while the second enables it. In Palette's official app, white\_balance is set to false by default. Although less robust than auto\_color, this setting performs well with higher quality images, providing a cleaner appearance.
{% endhint %}

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

### Temperature Adjustment

* Parameter: *temperature*
* Enabled value: -1.0 - 1.0
* Disable value: 0.0
* Example: Standard filters 1-20 with temperature going from - 1.0 - 1.0

{% hint style="info" %}
Image temperature ranges from -1.0 to 1.0, with 0.0 disabling the adjustment. The official Palette app sets the default value at -0.1. Older images tend to lose contrast and appear flat in color. Applying a slightly colder filter on the mid-tones enhances image cleanliness and adds depth.
{% endhint %}

<figure><img src="/files/3SsbMrVsCRXjIOD4C8H5" alt=""><figcaption></figcaption></figure>

### Saturation Adjustment

* Parameter: *saturation*
* Enabled value: 0.0 - 2.0
* Disable value: 1.0
* Example: Standard filters 1-20 with saturation going from 0.0 - 2.0

{% hint style="info" %}
Image saturation ranges from 0.0 to 2.0, with 1.0 disabling the adjustment. The official Palette app sets the default value at 1.1, slightly boosting colors for a more vibrant appearance.
{% endhint %}

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

### Reference Image

* Parameter: *image\_ref*

{% hint style="info" %}
Utilize the reference image to approximate the color scheme in your colorization. Ensuring the general color pattern is similar will lead to a pleasing result. Feel free to explore creativity by incorporating elements such as flowers or butterflies to enhance the color palette.
{% endhint %}

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


# Subscription plans

An overview of your different options

**New: Windows Desktop Application:** Streamline your professional workflow with [Covenant's desktop app for Windows](https://covenant.software/getting-started/), using the Palette Colorization engine.

Or try the [simplified Video Colorization](https://neural.love/video-colorization?via=1n2cp) with our partner Nerual Love.

Note: [Register to the Palette Video API here](https://rapidapi.com/palette-app-palette-app-default/api/colorize-video/pricing)

**Video credits:**&#x20;

* 1 Credits per SD video frame
* 2 Credits per Full-HD video frame
* 3 Credits per 4K video frame
* 1 Credits for one call to the prompt API

## Video Pricing overview

<table><thead><tr><th>Plan</th><th width="150">Image Credits</th><th>$/extra credits</th><th width="97">QPS</th><th>Price</th></tr></thead><tbody><tr><td>Ultra</td><td>67,500</td><td>$0.0013</td><td>5</td><td>$89</td></tr><tr><td>Mega</td><td>180,000</td><td>$0.001</td><td>7</td><td>$189</td></tr></tbody></table>

Costs per video minute in dollar

<table><thead><tr><th>Plan</th><th width="170">SD/min </th><th>Full-HD/min</th><th>4K/min</th></tr></thead><tbody><tr><td>Ultra</td><td>$1.98</td><td>$3.15</td><td>$4.74</td></tr><tr><td>Mega</td><td>$1.58</td><td>$2.4</td><td>$3.6</td></tr></tbody></table>

You can combine say SD and 4K video frames, but if you download all in one format, here is how many minutes of footage you get for each format.

<table><thead><tr><th width="273">Plan</th><th width="144.33333333333331">SD</th><th>or Full-HD</th><th>or 4K</th></tr></thead><tbody><tr><td>Ultra</td><td>45 min</td><td>22.5 min</td><td>15  min</td></tr><tr><td>Mega</td><td>120 min</td><td>60 min</td><td>40 min</td></tr></tbody></table>

QPS stands for Queries Per Second, which is a metric used to measure the rate of requests or transactions being made to a server or system. It quantifies the number of queries or requests being processed per second by an API or application.&#x20;

### Video Frame Size

1. SD: 640x480
2. Full-HD: 1920x1080
3. 4K: 3840x2160

Note: the aspect ratio can be different, it only limits the total amount of pixels, for example 4K can be 3840x2160 or 2160x3840.

## Endpoints

**Video Frame Endpoints:**

1. \[POST] /colorize\_video\_frame\_with\_prompt
2. \[POST] /colorize\_video\_frame\_with\_reference\_image
3. \[POST] /generate\_video\_frame\_prompt

The Image Colorization API includes four endpoints, while the Video Colorization API provides three. An additional endpoint is available in the Image API to facilitate easier integration with apps. The /colorize\_image\_with\_auto\_prompt\_base64 endpoint returns the image in base64 format, making it simple to display the result on the client side. Additionally, a caption field is returned if you wish to utilize the prompt that generated the colorization.

In the Image API, an automatic prompt and image can be generated simultaneously. However, with the Video API, you must first generate the prompt, and then use the prompt and image to create the colorized result. The Video API is designed to reuse prompts and reference images, reducing server load.


# Video Colorization with Google Colab

New: Try the [simplified Video Colorization](https://neural.love/video-colorization?via=1n2cp) with our partner Nerual Love.

Note: the demo is using the old API platform, there is the [new API on RapidAPI](https://rapidapi.com/palette-app-palette-app-default/api/colorize-video/)

{% embed url="<https://www.loom.com/share/2d7337051d5d4051aafbc005b04ffa83?sid=76a59bd2-ef10-41a0-9de9-48a26a74fe9b>" %}

{% embed url="<https://colab.research.google.com/drive/1iJQZ1mdwAQVniAD38lXHY23pas38ZTo5?usp=sharing>" %}

[**-> Examples on Twitter**](https://twitter.com/palettefm/status/1678464545294000131)

**Examples in Google Drive:**

{% embed url="<https://drive.google.com/drive/folders/1Um2blwvT_nUR7JrqYcTmHwzu3OR3dIyb?usp=drive_link>" %}


# Video python snippets

Get up to speed with the video API

## Generate 20 captions

```python
import requests
import json

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fj43524'
X_RapidAPI_Host = 'colorize-video.p.rapidapi.com'

headers = {
    'X-RapidAPI-Key': '4116843d07msh704be0dfa337826p108b3fjsn7ab402961f9f',
    'X-RapidAPI-Host': 'colorize-video.p.rapidapi.com',
}

url = "https://" + X_RapidAPI_Host + "/generate_video_frame_prompt"

files = {
    'image': ('test.jpg', open('./test.jpg', 'rb'), 'image/jpeg')   
}

data = {
  "standard_filter_id": "0", # 1-20, 0 is disabled 
  "artistic_filter_id": "0", # 1-100, 0 is disabled
  "all_standard_filters": "true", # return all 20 prompts
  "all_artistic_filters": "false", # return all 100 prompts
  "raw_captions": "false" # remove pre and post fix to the caption
}

response = requests.post(url, files=files, data=data, headers=headers)
prompts = data = json.loads(response.text)
```

## Create 20 versions of one frame

```python
import requests

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fj43524'
X_RapidAPI_Host = 'colorize-video.p.rapidapi.com'

headers = {
    'X-RapidAPI-Key': '4116843d07msh704be0dfa337826p108b3fjsn7ab402961f9f',
    'X-RapidAPI-Host': 'colorize-video.p.rapidapi.com',
}

url = "https://" + X_RapidAPI_Host + "/colorize_video_frame_with_prompt"

data = {
      "resolution": "sd", #sd, full-hd, or 4k
      "prompt": "", # The prompt to colorize an image
      "auto_color": "false", # Apply automatic color balancing
      "white_balance": "false", # Apply automatic white balancing
      "temperature": "0.0", # -1.0 - 1.0, Apply color temperature
      "saturation": "1.0" # 0.0 - 2.0, Change saturation 
    }

for i, prompt in enumerate(prompts):
    
    files = {
        'image': ('test.jpg', open('./test.jpg', 'rb'), 'image/jpeg')   
    }

    data['prompt'] = prompt

    response = requests.post(url, files=files, data=data, headers=headers)
    f = open(str(i) + ".jpg", 'wb')
    f.write(response.content)
    f.close()
```

## Extract all the frames from a video

```python
import cv2
import os

def extract_images_from_video(video_path, output_folder):
    if not os.path.exists(output_folder):
        os.makedirs(output_folder)

    # Open the video file
    video = cv2.VideoCapture(video_path)

    # Check if the video was opened successfully
    if not video.isOpened():
        print("Error: Could not open the video file.")
        return

    # Extract images from the video
    frame_number = 0
    while True:
        ret, frame = video.read()

        # Break the loop if we have reached the end of the video
        if not ret:
            break

        # Save the current frame as an image
        output_filename = os.path.join(output_folder, f"frame{frame_number}.png")
        cv2.imwrite(output_filename, frame)
        frame_number += 1

    # Release the video object and close all windows
    video.release()
    cv2.destroyAllWindows()
    print(f"Images extracted and saved in the folder: {output_folder}")
```

## Colorize all the frames with the same prompt

```python
import os
import time
import requests

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fj43524'
X_RapidAPI_Host = 'colorize-video.p.rapidapi.com'

headers = {
    'X-RapidAPI-Key': '4116843d07msh704be0dfa337826p108b3fjsn7ab402961f9f',
    'X-RapidAPI-Host': 'colorize-video.p.rapidapi.com',
}

def colorize_image(input_file, output_file, prompt):
  
    url = "https://" + X_RapidAPI_Host + "/colorize_video_frame_with_prompt"
    
    files = {
        'image': (input_file, open(input_file, 'rb'), 'image/jpeg')
    }
    data = {
        "resolution": "sd",
        "prompt": prompt,
        "auto_color": "false",
        "white_balance": "false",
        "temperature": "0.0",
        "saturation": "1.0"
    }
    response = requests.post(url, files=files, data=data, headers=headers)
    
    with open(output_file, 'wb') as f:
        f.write(response.content)

def process_files(input_folder, output_folder, prompt):
    if not os.path.exists(output_folder):
        os.makedirs(output_folder)

    for filename in os.listdir(input_folder):
        input_file = os.path.join(input_folder, filename)
        output_file = os.path.join(output_folder, f'colorized_{filename}')
        success = False
        retries = 0

        while not success and retries < 10:
            try:
                colorize_image(input_file, output_file, prompt)
                success = True
            except Exception as e:
                print(f"Error processing {input_file}: {e}")
                time.sleep(60)
                retries += 1

input_folder = './input'
output_folder = './output'
prompt = "Your selected prompt"
process_files(input_folder, output_folder, prompt)

```

## Colorize all the images with the same reference image

```python
import os
import time
import requests
from pathlib import Path

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fj43524'
X_RapidAPI_Host = 'colorize-video.p.rapidapi.com'

headers = {
    'X-RapidAPI-Key': '4116843d07msh704be0dfa337826p108b3fjsn7ab402961f9f',
    'X-RapidAPI-Host': 'colorize-video.p.rapidapi.com',
}

def colorize_files(input_folder, output_folder, ref_image_path):
    
    url = "https://" + X_RapidAPI_Host + "/colorize_video_frame_with_prompt"
   
    data = {
        "resolution": "sd",
        "auto_color": "false",
        "white_balance": "false",
        "temperature": "0.0",
        "saturation": "1.0"
    }
    
    Path(output_folder).mkdir(parents=True, exist_ok=True)
    
    for file_name in os.listdir(input_folder):
        if file_name.lower().endswith(('.jpg', '.jpeg')):
            input_file_path = os.path.join(input_folder, file_name)
            output_file_path = os.path.join(output_folder, f'colorized_{file_name}')
            
            for _ in range(10):
                try:
                    files = {
                        'image': (file_name, open(input_file_path, 'rb'), 'image/jpeg'),
                        'image_ref': ('ref_image.jpg', open(ref_image_path, 'rb'), 'image/jpeg')
                    }
                    response = requests.post(url, files=files, data=data, headers=headers)
                    response.raise_for_status()
                    
                    with open(output_file_path, 'wb') as f:
                        f.write(response.content)
                    
                    print(f"Colorized {file_name} and saved as {output_file_path}")
                    break
                except Exception as e:
                    print(f"Error while processing {file_name}: {e}")
                    time.sleep(60)

input_folder = './input_folder'
output_folder = './output_folder'
ref_image_path = 'ref_image.jpg'

colorize_files(input_folder, output_folder, ref_image_path)

```

## Use the previous frame to colorize one after each other

```python
import os
import time
import requests
from pathlib import Path

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fj43524'
X_RapidAPI_Host = 'colorize-video.p.rapidapi.com'

headers = {
    'X-RapidAPI-Key': '4116843d07msh704be0dfa337826p108b3fjsn7ab402961f9f',
    'X-RapidAPI-Host': 'colorize-video.p.rapidapi.com',
}

def colorize_images(folder_path):
    
    url = "https://" + X_RapidAPI_Host + "/colorize_video_frame_with_prompt"
   
    data = {
        "resolution": "sd",
        "auto_color": "false",
        "white_balance": "false",
        "temperature": "0.0",
        "saturation": "1.0"
    }
    
    output_folder = Path(folder_path) / "colorized"
    output_folder.mkdir(parents=True, exist_ok=True)

    reference_image = Path(folder_path) / "the_first_reference.jpg"

    for file in os.listdir(folder_path):
        if file.endswith(".jpg") or file.endswith(".jpeg"):
            input_file = Path(folder_path) / file

            retries = 10
            while retries > 0:
                try:
                    files = {
                        'image': (file, open(input_file, 'rb'), 'image/jpeg'),
                        'image_ref': ('ref_image.jpg', open(reference_image, 'rb'), 'image/jpeg')
                    }

                    response = requests.post(url, files=files, data=data, headers=headers)
                    response.raise_for_status()

                    colorized_file = output_folder / f'colorized_{file}'
                    with open(colorized_file, 'wb') as f:
                        f.write(response.content)

                    reference_image = colorized_file
                    break

                except requests.exceptions.RequestException:
                    retries -= 1
                    time.sleep(60)
                    
colorize_images("path/to/your/folder")

```


# API reference


# Colorize image with reference image

{% openapi src="/files/v0Q61hCR2aSptAqJL0YH" path="/colorize\_image\_with\_reference\_image" method="post" %}
[api open (1).json](https://64348216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FblRNjHUcHVFloQvO8jOF%2Fuploads%2FjyhqbFzjG4FwPMAB24UF%2Fapi%20open%20\(1\).json?alt=media)
{% endopenapi %}


# Colorize image with auto prompt

{% openapi src="/files/v0Q61hCR2aSptAqJL0YH" path="/colorize\_image\_with\_auto\_prompt" method="post" %}
[api open (1).json](https://64348216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FblRNjHUcHVFloQvO8jOF%2Fuploads%2FjyhqbFzjG4FwPMAB24UF%2Fapi%20open%20\(1\).json?alt=media)
{% endopenapi %}


# Colorize image with auto prompt base64

{% openapi src="/files/v0Q61hCR2aSptAqJL0YH" path="/colorize\_image\_with\_auto\_prompt\_base64" method="post" %}
[api open (1).json](https://64348216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FblRNjHUcHVFloQvO8jOF%2Fuploads%2FjyhqbFzjG4FwPMAB24UF%2Fapi%20open%20\(1\).json?alt=media)
{% endopenapi %}


# Colorize video frame with prompt

{% openapi src="/files/v0Q61hCR2aSptAqJL0YH" path="/colorize\_video\_frame\_with\_prompt" method="post" %}
[api open (1).json](https://64348216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FblRNjHUcHVFloQvO8jOF%2Fuploads%2FjyhqbFzjG4FwPMAB24UF%2Fapi%20open%20\(1\).json?alt=media)
{% endopenapi %}


# Colorize video frame with reference image

{% openapi src="/files/v0Q61hCR2aSptAqJL0YH" path="/colorize\_video\_frame\_with\_reference\_image" method="post" %}
[api open (1).json](https://64348216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FblRNjHUcHVFloQvO8jOF%2Fuploads%2FjyhqbFzjG4FwPMAB24UF%2Fapi%20open%20\(1\).json?alt=media)
{% endopenapi %}


# Generate video frame prompt

{% openapi src="/files/v0Q61hCR2aSptAqJL0YH" path="/generate\_video\_frame\_prompt" method="post" %}
[api open (1).json](https://64348216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FblRNjHUcHVFloQvO8jOF%2Fuploads%2FjyhqbFzjG4FwPMAB24UF%2Fapi%20open%20\(1\).json?alt=media)
{% endopenapi %}


# Generate image prompt

{% openapi src="/files/v0Q61hCR2aSptAqJL0YH" path="/generate\_image\_prompt" method="post" %}
[api open (1).json](https://64348216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FblRNjHUcHVFloQvO8jOF%2Fuploads%2FjyhqbFzjG4FwPMAB24UF%2Fapi%20open%20\(1\).json?alt=media)
{% endopenapi %}


# Other resources


