> ## Documentation Index
> Fetch the complete documentation index at: https://ailabtools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Color Migration

> Color Migration API recolors images automatically or with a target palette while preserving key visual regions.

export const FileStoragePolicy = ({uploadedFiles, responseType}) => {
  const responseFileData = {
    URL: {
      stored: "Yes",
      retention: "24 Hours",
      deletion: "Automatic"
    },
    BASE64: {
      stored: "No",
      retention: "N/A",
      deletion: "Immediate"
    }
  };
  if (!uploadedFiles && !responseType) return null;
  return <div>
      <table>
        <thead>
          <tr>
            <th>Data Type</th>
            <th>Stored</th>
            <th>Retention</th>
            <th>Training</th>
            <th>Deletion</th>
          </tr>
        </thead>
        <tbody>
          {uploadedFiles && <tr>
              <td>Uploaded Files</td>
              <td>No</td>
              <td>N/A</td>
              <td>No</td>
              <td>Immediate</td>
            </tr>}
          {responseType && responseFileData?.[responseType] && <tr>
              <td>Response Files ({responseType})</td>
              <td>{responseFileData[responseType]['stored']}</td>
              <td>{responseFileData[responseType]['retention']}</td>
              <td>No</td>
              <td>{responseFileData[responseType]['deletion']}</td>
            </tr>}
        </tbody>
      </table>

      <Tip>
        For more information, see the{" "}<a href="/docs/file-storage-policy">File Storage Policy</a> and{" "}<a href="https://www.ailabtools.com/privacy-policy" target="_blank">Privacy Policy</a>.
      </Tip>
    </div>;
};

export const BillingInstructions = ({creditsPerRequest = 1}) => {
  const creditUnitPrice = 0.0027;
  const billingTiers = [{
    price: 6,
    credits: 2000,
    costPerCredit: 0.003
  }, {
    price: 30,
    credits: 10000,
    costPerCredit: 0.003
  }, {
    price: 300,
    credits: 110000,
    costPerCredit: 0.0027
  }, {
    price: 1500,
    credits: 550000,
    costPerCredit: 0.0027
  }, {
    price: 2500,
    credits: 1000000,
    costPerCredit: 0.0025
  }];
  const formatCurrency = (value, fractionDigits = 2) => value.toLocaleString("en-US", {
    style: "currency",
    currency: "USD",
    minimumFractionDigits: fractionDigits,
    maximumFractionDigits: fractionDigits
  });
  const formatNumber = (value, fractionDigits = 0) => value.toLocaleString("en-US", {
    minimumFractionDigits: fractionDigits,
    maximumFractionDigits: fractionDigits
  });
  return <>
      <table>
        <thead>
          <tr>
            <th style={{
    textAlign: "right"
  }}>Price</th>
            <th style={{
    textAlign: "right"
  }}>Requests</th>
            <th style={{
    textAlign: "right"
  }}>Cost / Request</th>
          </tr>
        </thead>
        <tbody>
          {billingTiers.map(tier => {
    const requests = tier.credits / creditsPerRequest;
    const costPerRequest = tier.costPerCredit * creditsPerRequest;
    return <tr key={tier.credits}>
                <td style={{
      textAlign: "right"
    }}>{formatCurrency(tier.price)}</td>
                <td style={{
      textAlign: "right"
    }}>{formatNumber(requests)}</td>
                <td style={{
      textAlign: "right"
    }}>
                  {formatCurrency(costPerRequest, 4)}
                </td>
              </tr>;
  })}
        </tbody>
      </table>

      <Tip>
        Each successful API request consumes{" "}<strong>{creditsPerRequest} credits (≈{" "}{formatCurrency(creditUnitPrice * creditsPerRequest, 4)})</strong>. Failed requests are not billed.

        <ul>
          <li>
            View pricing on the{" "}<a href="https://www.ailabtools.com/price?tab=api" target="_blank">pricing page</a>{" "}or manage credits in the{" "}<a href="https://www.ailabtools.com/developer/billing" target="_blank">developer platform</a>.
          </li>
          <li>
            Need more credits or an enterprise plan? Contact{" "}<a href="mailto:business@ailabtools.com">business@ailabtools.com</a>.
          </li>
        </ul>
      </Tip>
    </>;
};

<Danger>
  \[Important: API Service Retirement Notice]

  Dear Developers,

  Thank you for your continued trust and support of the AILabTools API.

  To better focus on delivering more efficient, stable, and future-ready solutions, we are announcing the retirement of this API.

  Due to its outdated architecture and limitations in performance and scalability, this API will be permanently discontinued and will no longer be available starting from the date of this announcement. Any applications or integrations that still rely on this API may experience service interruptions if no action is taken.

  We strongly recommend that you evaluate alternative solutions and plan your migration as soon as possible to ensure a smooth transition and uninterrupted service for your users.

  If you have any questions or need assistance during this transition, our support team is ready to help:
  📧 [support@ailabtools.com](mailto:support@ailabtools.com)

  We sincerely appreciate your understanding and cooperation. Thank you for being part of AILabTools. We remain committed to providing you with more powerful and reliable services.

  Best regards,

  AILabTools Support Team
</Danger>

## Renderings show

* **Automatic color extension**

  Enter the number of results to be expanded, that is, the number of expanded color systems. The algorithm calculates the uniform sampling method according to the color space, and gives the results that meet the requirements of the number of expanded colors. Simply put, the number of color systems is how many, and a few pictures are output.

  For example, 【Before processing】【`color_count`=`1`】【`color_count`=`4`】. The result is as follows:

  ![Image](https://img.ailabtools.com/rapidapi/ColourMigration/processed-auto-splicing-3.jpg)

* **Color palette extension**

  Input a set of color lists (color swatches), and the algorithm uses the swatches as the main color to expand the original image. This mode provides greater color control. The length of the color list must not exceed the specified value.

  For example, 【`color_template`="#DB0D0D,#0E0CBB,#FF0000"】. The color extension result is as follows:

| Before processing                                                                         | After processing                                                                                  |
| :---------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------ |
| ![Before processing](https://img.ailabtools.com/rapidapi/ColourMigration/untreated-2.jpg) | ![After processing](https://img.ailabtools.com/rapidapi/ColourMigration/processed-template-1.jpg) |

* **Reference picture extension color**

  You provide a reference image, and the algorithm will colorize the original image based on the reference image.

| Before processing                                                                         | Reference map                                                                                     | After processing                                                                                 |
| :---------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------- |
| ![Before processing](https://img.ailabtools.com/rapidapi/ColourMigration/untreated-3.jpg) | ![Reference map](https://img.ailabtools.com/rapidapi/ColourMigration/processed-ref_pic-ref-1.jpg) | ![After processing](https://img.ailabtools.com/rapidapi/ColourMigration/processed-ref_pic-1.jpg) |

## Billing Instructions

<BillingInstructions creditsPerRequest={3} />

## File Storage Policy

<FileStoragePolicy uploadedFiles responseType="URL" />
