- 1,000 conversions/month
- 10 requests/minute
- 12 MB max file size
- Image format conversion (JPG, PNG, WebP, etc.)
- Resize width & height dynamically
- Adjustable compression level
- Realtime image processing
Image Conversion API
Convert images between formats (PNG to WebP, HEIC to JPEG, etc.) with optional resizing and quality control. Fast, reliable, and easy to integrate.
Powerful image processing
Convert, resize, and optimize images with a simple API call. Support for all major formats.
Format Conversion
Convert between 25+ formats including WebP, HEIC, AVIF, PNG, JPEG, and more.
Dynamic Resize
Resize images to any dimension while maintaining aspect ratio automatically.
Quality Control
Adjust compression level from 0-100 to balance quality and file size.
Fast Processing
High-performance servers deliver converted images in milliseconds.
Simple, transparent pricing
Start free and scale as you grow. No hidden fees.
- 5,000 conversions/month
- 30 requests/minute
- 24 MB max file size
- Image format conversion (JPG, PNG, WebP, etc.)
- Resize width & height dynamically
- Adjustable compression level
- Realtime image processing
- Email support
- 20,000 conversions/month
- 60 requests/minute
- 32 MB max file size
- Image format conversion (JPG, PNG, WebP, etc.)
- Resize width & height dynamically
- Adjustable compression level
- Realtime image processing
- Accelerated processing
- Priority support
- Unlimited conversions
- Custom rate limits
- Up to 64 MB image size
- Image format conversion (JPG, PNG, WebP, etc.)
- Resize & maintain aspect ratio
- Adjustable compression level
- Accelerated conversion under heavy usage
- 24/7 priority support
API reference
Everything you need to integrate the Image Conversion API.
Authentication
All API requests require authentication using your API key. The API key must be sent via the X-API-KEY header with every request.
X-API-KEY: your_api_key_here Get your API key. Sign up at dash.corenexis.com to get your API key instantly.
API endpoint
POSThttps://api.corenexis.com/image-conversion/v1
The API accepts POST requests with image data sent as file upload, URL, or base64 encoded string.
Image input (required — one of the following)
| Parameter | Type | Description |
|---|---|---|
image or file Required* |
File | Image file upload (multipart/form-data). Any field name accepted. |
url Required* |
String | URL of the image to convert. Supports direct URLs and Google Drive public links. |
base64 Required* |
String | Base64 encoded image data (with or without data URI prefix) |
* Provide one of the above — file upload, URL, or base64. Not all three.
Optional parameters
| Parameter | Type | Description |
|---|---|---|
X-API-KEY Header |
String | Your API key (required in request headers) |
format |
String | Output format (webp, jpeg, png, heic, avif, etc.) |
width |
Integer | Output width in pixels. If only width is provided, height is auto-calculated to maintain aspect ratio. |
height |
Integer | Output height in pixels. If only height is provided, width is auto-calculated to maintain aspect ratio. |
quality |
Integer | Compression quality (0-100, default: original). Lower values = smaller file size. |
Google Drive URLs supported. You can convert images directly from Google Drive using any public link format: https://drive.google.com/uc?export=download&id=YOUR_FILE_ID or https://drive.google.com/file/d/YOUR_FILE_ID/view. Make sure the file sharing is set to “Anyone with the link” for this to work.
Supported formats
The API supports conversion between 25+ image formats. Both input and output formats are supported.
Popular formats
jpeg · jpg · png · webp · avif · heic · heif · gif
All supported formats
jpeg · jpg · png · gif · webp · avif · heic · heif · tiff · tif · bmp · pdf · ico · jp2 · jxl · tga · pcx · psd · eps · dds · exr · hdr · wbmp · xbm · xpm
Pro tip. Use WebP or AVIF for the best compression with minimal quality loss. AVIF is the smallest of the three for photographs; JPEG XL is smaller again where your consumers support it.
What the converter handles for you
| Situation | What happens |
|---|---|
| Transparency into a format without an alpha channel, such as JPEG | Composited onto white rather than black. |
| An animated GIF or WebP | Every frame is kept when the target format can hold one, and frames are flattened before resizing so they are not corrupted. Converting to a still format gives you the first frame. |
| A CMYK source, as print files usually are | Converted to sRGB through its embedded profile, so browsers show the colours you expect. |
| A photograph carrying an EXIF orientation tag | The rotation is applied, so the result is not on its side. |
| An SVG | Rendered with full support for gradients, opacity and text. |
| Metadata and colour profiles | Used where they matter, then stripped, so nothing you did not intend to publish travels with the file. |
A target format with a size limit, such as ico |
Scaled to fit rather than refused. Icons are capped at 256 pixels by the container itself. |
Asking for a smaller image is faster. Send width or height and the decoder produces the reduced size directly instead of building the full-resolution image first. On a 4000×3000 photograph that is the difference between about 1.5 seconds and about 0.7.
Code examples
Convert PNG to WebP (file upload)
curl -X POST https://api.corenexis.com/image-conversion/v1 \
-H "X-API-KEY: your_api_key" \
-F "image=@photo.png" \
-F "format=webp" const formData = new FormData();
formData.append('image', fileInput.files[0]);
formData.append('format', 'webp');
const response = await fetch('https://api.corenexis.com/image-conversion/v1', {
method: 'POST',
headers: {
'X-API-KEY': 'your_api_key'
},
body: formData
});
const data = await response.json();
if (data.success) {
console.log('Converted URL:', data.data.url);
console.log('New Size:', data.data.size, 'KB');
console.log('Dimensions:', data.data.dimension);
} import requests
url = "https://api.corenexis.com/image-conversion/v1"
headers = {
"X-API-KEY": "your_api_key"
}
files = {
"image": open("photo.png", "rb")
}
data = {
"format": "webp"
}
response = requests.post(url, headers=headers, files=files, data=data)
result = response.json()
if result["success"]:
print(f"Converted URL: {result['data']['url']}")
print(f"New Size: {result['data']['size']} KB")
print(f"Dimensions: {result['data']['dimension']}") $ch = curl_init();
$postFields = [
'image' => new CURLFile('photo.png'),
'format' => 'webp'
];
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.corenexis.com/image-conversion/v1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-API-KEY: your_api_key"
],
CURLOPT_POSTFIELDS => $postFields
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
if ($data["success"]) {
echo "Converted URL: " . $data["data"]["url"] . "\n";
echo "New Size: " . $data["data"]["size"] . " KB\n";
echo "Dimensions: " . $data["data"]["dimension"] . "\n";
} Convert HEIC to JPEG with resize
curl -X POST https://api.corenexis.com/image-conversion/v1 \
-H "X-API-KEY: your_api_key" \
-F "image=@IMG_1234.heic" \
-F "format=jpeg" \
-F "width=1200" \
-F "height=800" \
-F "quality=90" const formData = new FormData();
formData.append('image', fileInput.files[0]);
formData.append('format', 'jpeg');
formData.append('width', '1200');
formData.append('height', '800');
formData.append('quality', '90');
const response = await fetch('https://api.corenexis.com/image-conversion/v1', {
method: 'POST',
headers: {
'X-API-KEY': 'your_api_key'
},
body: formData
});
const data = await response.json();
console.log(data); import requests
url = "https://api.corenexis.com/image-conversion/v1"
headers = {"X-API-KEY": "your_api_key"}
files = {"image": open("IMG_1234.heic", "rb")}
data = {
"format": "jpeg",
"width": 1200,
"height": 800,
"quality": 90
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json()) Convert from URL
curl -X POST https://api.corenexis.com/image-conversion/v1 \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/image.png", "format": "webp"}' const response = await fetch('https://api.corenexis.com/image-conversion/v1', {
method: 'POST',
headers: {
'X-API-KEY': 'your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com/image.png',
format: 'webp',
quality: 85
})
});
const data = await response.json();
console.log(data); Convert from Google Drive
# Convert directly from Google Drive (public link required)
# File sharing must be set to "Anyone with the link"
curl -X POST https://api.corenexis.com/image-conversion/v1 \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://drive.google.com/uc?export=download&id=YOUR_FILE_ID",
"format": "webp",
"width": 1920,
"quality": 85
}' // Convert image directly from Google Drive
// Make sure the file is shared as "Anyone with the link"
const driveFileId = 'YOUR_FILE_ID';
const driveUrl = `https://drive.google.com/uc?export=download&id=${driveFileId}`;
const response = await fetch('https://api.corenexis.com/image-conversion/v1', {
method: 'POST',
headers: {
'X-API-KEY': 'your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: driveUrl,
format: 'webp',
width: 1920,
quality: 85
})
});
const data = await response.json();
if (data.success) {
console.log('Converted URL:', data.data.url);
} else {
console.error('Error:', data.error);
} import requests
url = "https://api.corenexis.com/image-conversion/v1"
headers = {
"X-API-KEY": "your_api_key",
"Content-Type": "application/json"
}
# Google Drive file must be shared as "Anyone with the link"
drive_file_id = "YOUR_FILE_ID"
payload = {
"url": f"https://drive.google.com/uc?export=download&id={drive_file_id}",
"format": "webp",
"width": 1920,
"quality": 85
}
response = requests.post(url, headers=headers, json=payload)
result = response.json()
if result["success"]:
print(f"Converted URL: {result['data']['url']}")
else:
print(f"Error: {result['error']}") Google Drive tip. Only files set to “Anyone with the link” can be converted. Restricted or private files will return an error. Multiple URL formats are supported including /file/d/ID/view and ?id=ID.
Convert from Base64
curl -X POST https://api.corenexis.com/image-conversion/v1 \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"format": "webp"
}' // Convert file to base64
const toBase64 = (file) => new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result.split(',')[1]);
reader.onerror = reject;
});
const base64Data = await toBase64(fileInput.files[0]);
const response = await fetch('https://api.corenexis.com/image-conversion/v1', {
method: 'POST',
headers: {
'X-API-KEY': 'your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
base64: base64Data,
format: 'webp'
})
});
const data = await response.json();
console.log(data); More cURL examples
# Resize to exact dimensions (no format change)
curl -X POST https://api.corenexis.com/image-conversion/v1 \
-H "X-API-KEY: your_api_key" \
-F "image=@banner.png" \
-F "width=800" \
-F "height=600" # Compress image to 60% quality (no format change, no resize)
curl -X POST https://api.corenexis.com/image-conversion/v1 \
-H "X-API-KEY: your_api_key" \
-F "image=@photo.jpg" \
-F "quality=60" # Resize to 800px width, height auto-calculated (maintains aspect ratio)
curl -X POST https://api.corenexis.com/image-conversion/v1 \
-H "X-API-KEY: your_api_key" \
-F "image=@photo.jpg" \
-F "format=webp" \
-F "width=800" \
-F "quality=85" # Convert any image to AVIF (best compression for web)
curl -X POST https://api.corenexis.com/image-conversion/v1 \
-H "X-API-KEY: your_api_key" \
-F "image=@photo.jpg" \
-F "format=avif" \
-F "quality=80" Response format
Success response
{
"success": true,
"plan": "pro",
"data": {
"format": "webp",
"mimetype": "image/webp",
"url": "https://cdn.corenexis.com/image_1736697000_a3f2d8e1.webp",
"size": 245.67,
"expiry": "2026-01-12T14:30:00+00:00",
"dimension": "1200x800",
"compression_applied": true,
"compression_level": 85,
"width_applied": true,
"width": 1200,
"height_applied": true,
"height": 800
},
"usage": {
"remaining": 9688,
"rate_limit": 60,
"monthly_limit": 20000
}
} Response fields
| Field | Type | Description |
|---|---|---|
format |
String | Output image format (webp, jpeg, png, etc.) |
mimetype |
String | MIME type of the converted image |
url |
String | CDN URL to download the converted image |
size |
Float | File size in KB |
expiry |
String | ISO 8601 timestamp when the image URL expires (2 hours) |
dimension |
String | Output dimensions in WIDTHxHEIGHT format |
compression_applied |
Boolean | Whether compression/quality setting was applied |
compression_level |
Integer | Quality level used (0-100, null if not applied) |
width_applied |
Boolean | Whether width resize was applied |
width |
Integer | Output width in pixels (null if not applied) |
height_applied |
Boolean | Whether height resize was applied |
height |
Integer | Output height in pixels (null if not applied) |
Usage object
| Field | Type | Description |
|---|---|---|
remaining |
Integer | Remaining conversions for this billing period |
rate_limit |
Integer | Maximum requests allowed per minute |
monthly_limit |
Integer | Total monthly conversion limit for your plan |
Image expiry. Converted images are available for download for 2 hours after conversion. Make sure to download or cache the image before the expiry time.
Error codes
| HTTP | Code | Description |
|---|---|---|
| 400 | Bad Request | Missing image source, invalid format, invalid URL, or corrupt base64 data |
| 400 | File Size Exceeded | Image file size exceeds your plan’s maximum limit |
| 400 | Invalid Image | The provided file is not a valid image or is corrupted |
| 400 | Google Drive Error | Failed to download from Google Drive. File may be private or restricted. |
| 401 | INVALID_KEY |
API key is invalid, expired, or not found |
| 401 | Missing API Key | X-API-KEY header is not present in the request |
| 402 | NO_SUBSCRIPTION |
Image Conversion API not enabled for your account. Subscribe to a plan first. |
| 402 | SUBSCRIPTION_EXPIRED |
Your subscription has expired. Please renew to continue. |
| 402 | SUBSCRIPTION_CANCELLED |
Your subscription has been cancelled and the access period has ended. |
| 403 | KEY_DISABLED |
Your API key has been disabled. Generate a new key from the dashboard. |
| 403 | ACCOUNT_SUSPENDED |
Your account has been suspended. Contact support for assistance. |
| 403 | EMAIL_NOT_VERIFIED |
Verify your email address before using the API. |
| 413 | File Too Large | Image exceeds maximum file size limit for your plan |
| 429 | RATE_LIMIT_EXCEEDED |
Too many requests per minute. Wait and try again. |
| 429 | QUOTA_EXCEEDED |
Monthly conversion quota reached. Upgrade your plan for more conversions. |
| 500 | Server Error | Internal server error during image processing. Try again later. |
Error response examples
// 401 — Invalid API Key
{
"success": false,
"code": "INVALID_KEY",
"message": "The provided API key is invalid or has been revoked."
} // 400 — File Size Exceeds Plan Limit
{
"success": false,
"code": "PARAM_LIMIT_EXCEEDED",
"message": "File size (15.30MB) exceeds your plan limit (12.00MB). Please reduce the file size or upgrade your plan.",
"file_size_mb": 15.30,
"max_allowed_mb": 12.00
} // 429 — Rate Limit Exceeded
{
"success": false,
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please wait before making another request."
} // 429 — Monthly Quota Exceeded
{
"success": false,
"code": "QUOTA_EXCEEDED",
"message": "Monthly conversion quota exceeded. Upgrade your plan for more conversions."
} Note on plan limit errors. When your request exceeds plan limits (file size), the request is rejected but your monthly usage quota is not consumed. Only successfully processed conversions count toward your monthly limit.
Rate limiting. Rate limits are applied per minute based on your plan. If you receive a 429 error, wait 60 seconds before retrying. Consider upgrading your plan for higher limits.
Ready to get started?
Create your free account and start converting images in minutes. No credit card required.