API Endpoint Access URL
https://api.pixlab.io/deblur
Get an API Key and Try DEBLUR Now ↗AI Image Deblurring and Photo Restoration
The PixLab Image Deblur API (DEBLUR) reduces motion blur and camera shake in photographs with one REST request. Upload a JPEG, PNG, or WebP image or provide its public URL. The processed image preserves the original width, height, and aspect ratio.
Image deblurring estimates clearer detail from blurred visual information. It differs from sharpening, which increases contrast around existing edges. To enlarge a photo instead, use the Image Upscale and Enhancement API.
Built for developers supporting marketing teams, ecommerce businesses, and creative agencies, DEBLUR brings photo restoration into existing publishing workflows. Call it from your backend to process campaign photography, supplier images, property listings, or customer uploads before review and publication. Python, JavaScript, PHP, and Ruby examples are included below.
Compare motion blur with clearer window edges, brickwork, and bicycle detail in the same scene. This is an illustrative comparison, not an API output sample; actual results depend on the source photo.
What DEBLUR provides:
- A REST endpoint for backend services, automation workers, and scheduled jobs. No SDK is required.
- Motion-blur reduction without a client-generated image mask.
- Restoration at the original image dimensions, without cropping the scene.
- Input through a public image URL or direct file upload, with output as Base64 JSON data, raw image bytes, or a file in your connected AWS S3 bucket.
- JPEG, PNG, and WebP inputs up to 4,000,000 pixels and 10 MiB. Larger inputs are rejected rather than silently resized.
Bulk photo deblurring for catalogs and campaign libraries
Connect DEBLUR to your product information management (PIM), content management (CMS), or digital asset management (DAM) system through your own application. Each request processes one image. Queue catalog imports and campaign assets with bounded concurrency, within your account limits. For sustained high-volume processing, contact the PixLab support team with your daily volume and typical image dimensions.
Image deblurring for marketing, ecommerce, and real estate
- Marketing teams: reduce camera shake in event photos, lifestyle imagery, and campaign assets before preparing social media posts, email newsletters, and landing pages.
- Ecommerce and marketplaces: restore blurred supplier and seller photos for product detail pages and catalogs. Review labels, colors, and product features against the original before publishing.
- Creative and digital agencies: add a photo-restoration step to client asset intake and content production, with an approval stage for brand-sensitive imagery.
- Real estate and hospitality: reduce motion blur in property interiors, exterior views, and accommodation photos without changing their proportions.
- SaaS and photo-editing tools: integrate image deblurring into upload flows and editing applications using the same REST request pattern.
- Publishers and media archives: process scanned photographs and extracted video frames when reshooting is not possible, retaining the source for editorial review.
Output quality depends on the source image. Severe blur, compression, and missing detail can prevent faithful restoration. Keep the original and review faces, lettering, and repeated patterns before publishing the result.
Image processing and storage: Keep your source images for comparison. With a connected AWS S3 bucket, output can be written to your own storage. Review the PixLab Privacy Policy for processing and retention details.
To get started, create an API key in the PixLab Console ↗, submit a public image URL or upload a file, and consume the returned image data. See the Python, JavaScript, PHP, and Ruby samples below ↓.
Build a complete product-photo workflow with the Background Removal API for subject isolation and the Image Upscale API for larger gallery images. For authorized cleanup of text overlays on marketing assets, use the Text and Watermark Removal API.
Image Deblur API Pricing
PixLab offers monthly API plans for developers and businesses. Check your account for DEBLUR usage and rate limits before processing a large image collection.
- Starter: Review the current monthly allowance and account limits for your integration.
- Pro: Compare the available quota and throughput options as your image workload grows.
- Business and Enterprise: High-volume options for larger workloads, support, and dedicated deployment discussions.
Plan your workload: each DEBLUR request processes one image. Account for daily volume and peak concurrency when choosing a plan.
Review the current PixLab monthly API plans → or open the PixLab Console ↗ to check your usage and account limits.
HTTP Methods
GET, POST
Use GET with a public image URL or POST to upload a local file. Each request processes one source image.
HTTP Parameters
Required
| Fields | Type | Description |
|---|---|---|
img |
URL | Public URL of the image to deblur. To upload a local image directly from your application, send a multipart/form-data POST request instead. See POST Request Body. |
key |
String | Your PixLab API key ↗. You may send the key in the WWW-Authenticate HTTP header instead of this parameter. |
Optional
| Fields | Type | Description |
|---|---|---|
compress |
Boolean | JPEG outputs are compressed by default to reduce transfer size; PNG outputs remain lossless. Set this field to false to disable JPEG compression. |
blob |
Boolean |
By default, DEBLUR returns a JSON object containing the Base64-encoded output image or a link to the result in your connected AWS S3 bucket. Set this parameter to true to return the raw image bytes instead. See HTTP Response ↓ and the code samples for details.
|
POST Request Body
Use POST to upload a local image in the file field or submit a public image URL as JSON. JPEG, PNG, and WebP inputs must not exceed 4,000,000 pixels or 10 MiB. No image mask or prompt is required.
Supported content types:
multipart/form-dataapplication/json
Use multipart/form-data to upload an image directly from your application; see the PixLab GitHub repository ↗ for a working example. For application/json, the image must already be available by URL. You can call the STORE endpoint first when temporary upload storage is needed.
HTTP Response
application/json
By default, DEBLUR returns a JSON object containing the Base64-encoded output image. If your AWS S3 bucket is connected through the PixLab Console ↗, the response can provide a direct link to the result in your bucket instead. When the blob parameter is set to
true, the endpoint returns the raw image bytes rather than JSON.
| Fields | Type | Description |
|---|---|---|
status |
Integer | HTTP 200 indicates success. Any other code indicates failure. |
imgData |
Base64 Data | Base64 encoded string of the output image data. |
mimeType |
String | MIME type of the output image, such as image/png. |
extension |
String | File extension of the output image, such as png or jpeg. |
link |
URL | Direct link to the output image in your own AWS S3 bucket, when S3 storage is connected through the PixLab Console ↗. This field is returned instead of imgData. |
error |
String |
Error description when status != 200.
|
blob |
BLOB | Raw image data returned instead of a JSON object when the blob parameter is set to true. |
Code Samples
import base64
import os
from pathlib import Path
import requests
with open("photo.jpg", "rb") as image:
response = requests.post(
"https://api.pixlab.io/deblur",
headers={"WWW-Authenticate": os.environ["PIXLAB_API_KEY"]},
files={"file": ("photo.jpg", image, "image/jpeg")},
timeout=(10, 120),
)
response.raise_for_status()
result = response.json()
if result.get("status") != 200:
raise RuntimeError(result.get("error", "Image processing failed"))
if result.get("link"):
print("Image URL:", result["link"])
else:
extension = result["extension"]
if extension not in {"png", "jpeg", "jpg", "webp"}:
raise ValueError("Unexpected output format")
output = Path(f"deblur-output.{extension}")
output.write_bytes(base64.b64decode(result["imgData"], validate=True))
print(output)
// Run server-side with Node.js 20+ as an .mjs file.
import { readFile, writeFile } from "node:fs/promises";
async function processImage() {
const apiKey = process.env.PIXLAB_API_KEY;
if (!apiKey) throw new Error("Set PIXLAB_API_KEY in your environment.");
const form = new FormData();
const image = await readFile("photo.jpg");
form.append("file", new Blob([image], { type: "image/jpeg" }), "photo.jpg");
const response = await fetch("https://api.pixlab.io/deblur", {
method: "POST",
headers: { "WWW-Authenticate": apiKey },
body: form,
signal: AbortSignal.timeout(120000),
});
if (!response.ok) throw new Error("HTTP " + response.status);
const result = await response.json();
if (result.status !== 200) {
throw new Error(result.error || "Image processing failed");
}
if (result.link) {
console.log("Image URL:", result.link);
return;
}
if (!["png", "jpeg", "jpg", "webp"].includes(result.extension)) {
throw new Error("Unexpected output format");
}
const output = "deblur-output." + result.extension;
await writeFile(output, Buffer.from(result.imgData, "base64"));
console.log(output);
}
processImage().catch((error) => {
console.error(error.message);
process.exitCode = 1;
});
<?php
$apiKey = getenv('PIXLAB_API_KEY');
$imagePath = realpath('photo.jpg');
if (!$apiKey || $imagePath === false) {
throw new RuntimeException('Set PIXLAB_API_KEY and provide photo.jpg.');
}
$ch = curl_init('https://api.pixlab.io/deblur');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => ['WWW-Authenticate: ' . $apiKey],
CURLOPT_POSTFIELDS => [
'file' => new CURLFile($imagePath, 'image/jpeg', 'photo.jpg'),
],
]);
$response = curl_exec($ch);
$error = curl_error($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($response === false) {
throw new RuntimeException($error);
}
if ($httpStatus < 200 || $httpStatus >= 300) {
throw new RuntimeException('HTTP ' . $httpStatus);
}
$result = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
if (($result['status'] ?? null) !== 200) {
throw new RuntimeException($result['error'] ?? 'Image processing failed');
}
if (!empty($result['link'])) {
echo $result['link'] . PHP_EOL;
} else {
$extension = $result['extension'];
if (!in_array($extension, ['png', 'jpeg', 'jpg', 'webp'], true)) {
throw new RuntimeException('Unexpected output format');
}
$image = base64_decode($result['imgData'], true);
if ($image === false) {
throw new RuntimeException('Invalid image data');
}
$output = 'deblur-output.' . $extension;
if (file_put_contents($output, $image) === false) {
throw new RuntimeException('Could not save output image');
}
echo $output . PHP_EOL;
}
require 'net/http'
require 'json'
require 'base64'
uri = URI('https://api.pixlab.io/deblur')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.open_timeout = 10
http.read_timeout = 120
http.write_timeout = 120
request = Net::HTTP::Post.new(uri)
request['WWW-Authenticate'] = ENV.fetch('PIXLAB_API_KEY')
response = File.open('photo.jpg', 'rb') do |image|
request.set_form(
[['file', image, { filename: 'photo.jpg', content_type: 'image/jpeg' }]],
'multipart/form-data'
)
http.request(request)
end
raise "HTTP #{response.code}" unless response.is_a?(Net::HTTPSuccess)
result = JSON.parse(response.body)
raise(result['error'] || 'Image processing failed') unless result['status'] == 200
if result['link']
puts result['link']
else
extension = result.fetch('extension')
raise 'Unexpected output format' unless %w[png jpeg jpg webp].include?(extension)
output = "deblur-output.#{extension}"
File.binwrite(output, Base64.strict_decode64(result.fetch('imgData')))
puts output
end
Frequently Asked Questions
How do I deblur an image with the PixLab API?
Send a file upload or a public image URL to DEBLUR with your API key. No image mask is needed. Retrieve your key from the PixLab Console ↗.
What image formats and sizes are supported?
The API accepts JPEG, PNG, and WebP inputs up to 4,000,000 pixels and 10 MiB. Larger images are rejected rather than silently resized. Deblurring preserves the original dimensions. For enlargement, use the Image Upscale API →.
Can the API restore every blurry photo?
No. Severe blur, missing detail, and heavy compression can prevent faithful restoration. Keep the source image and review lettering, faces, and fine patterns. A clearer-looking result is not proof that every detail is correct.
Where can I check pricing and processing limits?
Check your account usage and rate limits in the PixLab Console. Submit one image per request and use bounded concurrency for bulk workloads. Review PixLab API pricing for subscription options.
How can the API return the processed image?
The endpoint can return Base64-encoded image data in JSON, raw image bytes when blob=true, or a direct link to output stored in your connected AWS S3 bucket.
Can marketing and ecommerce teams automate bulk photo deblurring?
Yes. Your developer can integrate DEBLUR into a product catalog, content management system, or digital asset workflow using one image per request. Queue images and keep concurrency within your account limits. Review product labels, brand elements, and important details before using restored photos in listings or campaigns.
Similar API Endpoints
upscale, bg-remove, describe, docscan, llm-parse, text-watermark-remove, image-text-translate, facelookup ↗, faceverify ↗, img-embed, query