MEDIANFILTER API Endpoint

Version 2.197 (Release Notes ↗)

Description

Apply the MEDIANFILTER API to enhance image quality by reducing noise, replacing each pixel with the median value of its neighbors. Perfect for developers and creators seeking clean, high-quality images. Applies a digital filter that improves the quality of a noisy image. Each pixel is replaced by the median in a set of neighboring pixels as defined by radius.

HTTP Methods

GET, POST

HTTP Parameters

Required

Fields Type Description
img URL Input image URL. For direct uploads, submit a multipart/form-data POST request.
radius Float Pixel neighborhood radius (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 contents when true (default: JSON with output URL).

POST Request Body

For POST requests instead of GET:

Allowed Content-Types:

  • multipart/form-data
  • application/json

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

HTTP Response

Fields Type Description
status Integer Status code 200 indicates success, any other code indicates failure.
link URL Link to the image output which is usually stored on the pixlab.xyz storage server unless you set your own S3 keys (refer to your dashboard ↗ on how to do that).
id String Unique image ID.
error String Error message if status != 200.

The API returns JSON (application/json) if the optional blob parameter is not set.

This endpoint returns a JSON Object after each call unless the blob parameter is specified, in which case the raw image binary is returned instead.

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