median

The median transformation applies a median filter to reduce noise while preserving edges. The filter replaces each pixel with the median value of neighboring pixels, making it effective for removing salt-and-pepper noise and smoothing surfaces while maintaining detail.

Serving Content via CDN

The Media API is a CDN-based service that serves transformed images via GET requests. When you request a transformed image URL, the transformation is applied dynamically on the first request and then cached for subsequent requests.

URL Pattern

https://media.vyso.io/median:radius=RADIUS/ASSET_ID.jpg

Examples

Small Median Filter

curl -i GET https://media.vyso.io/median:radius=1/ASSET_ID.jpg

Standard Median Filtering

curl -i GET https://media.vyso.io/median:radius=2/ASSET_ID.jpg

Medium Noise Reduction

curl -i GET https://media.vyso.io/median:radius=3/ASSET_ID.jpg

Aggressive Filtering

curl -i GET https://media.vyso.io/median:radius=5/ASSET_ID.jpg

On the first request, you'll receive a X-Cache: MISS header while the transformation is applied and cached. Subsequent requests will return X-Cache: HIT.

Parameters

radiusREQUIRED

Median filter radius in pixels. Accepted values:

  • Range: 1.0 to 10.0+
  • 1.0 - Subtle noise reduction
  • 2.0 - Standard median filtering
  • 3.0 - Moderate smoothing
  • 5.0 - Aggressive noise reduction
  • Larger radius processes more neighboring pixels; increases processing time

Response

The API returns the median-filtered image. The response format depends on the format of the asset stored in the Vyso asset cloud.

Content-Type: Determined by the stored asset format (e.g., image/jpeg, image/png)