API Endpoint Access URL
https://api.pixlab.io/resample
Get Your API Key & Try RESAMPLE Now ↗Description
Resample a given image to the desired resolution with the RESAMPLE API endpoint. Ideal for developers and creators looking to adjust image quality and size efficiently. Resample a given image to the desired resolution.
HTTP Methods
GET, POST
HTTP Parameters
Required
Fields | Type | Description |
---|---|---|
img |
URL | Input media URL. If you want to upload your image directly from your app, submit a multipart/form-data POST request. |
xr |
Integer | X Resolution (16-300 range). |
yr |
Integer | Y Resolution (16-300 range). |
blur |
Integer | Blur level (16-30 range). |
key |
String | Your PixLab API Key ↗. Alternatively, embed your key in the WWW-Authenticate: header. |
Optional
Fields | Type | Description |
---|---|---|
blob |
Boolean | Returns image binary contents when set to true (default: JSON response with output URL). |
POST Request Body
Use these Content-Type headers for POST requests:
multipart/form-data
- For direct file uploadsapplication/json
- For remote media processing
For file upload examples, check the REST API code samples. To pre-upload media via API, use the store endpoint.
HTTP Response
Fields | Type | Description |
---|---|---|
status |
Integer | Status code 200 indicates success, any other code indicates failure. |
link |
URL | Link to the media 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 media ID. |
error |
String | Error message if status != 200. |
The API returns application/json
if the optional blob parameter is not set.
This API endpoint returns a JSON Object after each call only if the optional blob parameter is not set. Otherwise, the media binary contents are 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...
// Refer to the PixLab Github Repository at: https://github.com/symisc/pixlab for the full list of production ready code samples...
# Refer to the PixLab Github Repository at: https://github.com/symisc/pixlab for the full list of production ready code samples...
# Refer to the PixLab Github Repository at: https://github.com/symisc/pixlab for the full list of production ready code samples...
Similar API Endpoints
newimage, scale, minify, magnify, ar, smartcrop, resize, smartresize, remap, crop, mogrify, thumbnail, merge, composite, docscan, avatar, webfit