COLORSPACE_RGB API Endpoint

Version 2.197 (Release Notes ↗)

Description

Change the colorspace of a given image to the RGB color model. Ideal for developers and creators looking to manipulate image colors in their projects.

HTTP Methods

GET, POST

HTTP Parameters

Required

Fields Type Description
img URL Input image URL. If you want to upload your image directly from your app, then submit a multipart/form-data POST request.
key String Your PixLab API Key ↗. You can also embed your key in the WWW-Authenticate: HTTP header and omit this parameter if you want to.

Optional

Fields Type Description
blob Boolean By default, this API endpoint returns a JSON Object holding the link to the image output. If set to true, the image binary contents are returned instead.

POST Request Body

Use this if you plan to submit a POST request instead of a simple GET request.

Allowed Content-Type:

  • multipart/form-data
  • application/json

Use multipart/form-data for direct image uploads. For JSON requests, ensure your image is already hosted elsewhere. Call the store endpoint first if you need to upload an image before processing.

HTTP Response

Required

The endpoint expects a application/json response format when the optional blob parameter is not set.

This endpoint returns a JSON Object unless the blob parameter is specified, in which case the raw image binary is returned. The JSON response includes the following fields:

Fields Type Description
status Integer Status code 200 indicates success. Any other code indicates failure.
link URL Link to the processed image, stored on pixlab.xyz unless custom S3 keys are configured (see console.pixlab.io for setup).
id String Unique identifier for the processed image.
error String Error details if status ≠ 200.

Optional

If the blob parameter is enabled, the endpoint returns the raw image binary instead of a JSON response.

Code Samples

# Refer to the PixLab Github Repository at: https://github.com/symisc/pixlab for the full list of production ready code samples...
← Return to API Endpoint Listing