Gamma API Endpoint

Version 2.197 (Release Notes ↗)

Description

The Gamma API endpoint lets you programmatically adjust the gamma correction levels of any input image. By modifying the midtone contrast, this filter rectifies exposure inconsistencies, brightens shadowed scenes, or calibrates images for varying digital screens without clipping highlights.

HTTP Methods

GET, POST

HTTP Parameters

Required

Fields Type Description
img URL Input image URL. If uploading directly, submit a multipart/form-data POST request.
gamma Float Gamma-correction amount (Max: 10.00).
key String Your PixLab API Key ↗. Alternatively, embed it in the WWW-Authenticate: header.

Optional

Fields Type Description
blob Boolean Returns image binary if true (default: JSON with output URL).
channel Integer Color channel constant. Combine with bitwise operators for multiple channels. Omit for all channels.
POST Request Body

Allowed Content-Types:

multipart/form-data
application/json

Use multipart/form-data for direct uploads (see REST API code samples). For JSON, the image must be pre-uploaded (use store endpoint first).

Channels Constant
Fields Value
CHANNEL_RED 1
CHANNEL_GRAY 1
CHANNEL_CYAN 1
CHANNEL_GREEN 2
CHANNEL_MAGENTA 2
CHANNEL_BLUE 4
CHANNEL_YELLOW 4
CHANNEL_ALPHA 8
CHANNEL_OPACITY 8
CHANNEL_MATTE 8
CHANNEL_BLACK 32
CHANNEL_INDEX 32
CHANNEL_ALL 134217727

HTTP Response

The GAMMA endpoint returns application/json if the optional blob parameter is not set.

This API endpoint returns a JSON Object after each call unless the blob parameter is specified, in which case the raw image binary is returned. The JSON response contains 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 description if status ≠ 200.

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