Official beta
We are in official beta.

Image Operations

Resize, crop, rotate, watermark, and enhance images

15 endpoints in this category. All require X-API-Key header.


Resize Image

POST /api/ResizeImage 1 token

Resize an image with flexible fit options.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
width number optional Target width
height number optional Target height
fit string optional cover, contain, fill, inside, outside (default: contain)
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "width": 800, "height": 600, "fit": "contain", "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/ResizeImage" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "width": 800, "height": 600, "fit": "contain", "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""width"": 800, ""height"": 600, ""fit"": ""contain"", ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/ResizeImage", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/ResizeImage"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "width": 800, "height": 600, "fit": "contain", "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/ResizeImage
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "width": 800,
│      "height": 600,
│      "fit": "contain",
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ResizeImage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Crop Image

POST /api/CropImage 1 token

Extract a rectangular region from an image.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
left number required X offset
top number required Y offset
width number required Crop width
height number required Crop height
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "left": 100, "top": 100, "width": 400, "height": 300, "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/CropImage" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "left": 100, "top": 100, "width": 400, "height": 300, "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""left"": 100, ""top"": 100, ""width"": 400, ""height"": 300, ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/CropImage", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/CropImage"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "left": 100, "top": 100, "width": 400, "height": 300, "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/CropImage
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "left": 100,
│      "top": 100,
│      "width": 400,
│      "height": 300,
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/CropImage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Rotate Image

POST /api/RotateImage 1 token

Rotate an image by a specified angle.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
angle number required Rotation in degrees
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "angle": 90, "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/RotateImage" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "angle": 90, "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""angle"": 90, ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/RotateImage", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/RotateImage"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "angle": 90, "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/RotateImage
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "angle": 90,
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/RotateImage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Flip Image

POST /api/FlipImage 1 token

Flip an image horizontally or vertically.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
direction string required horizontal or vertical
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "direction": "horizontal", "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/FlipImage" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "direction": "horizontal", "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""direction"": ""horizontal"", ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/FlipImage", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/FlipImage"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "direction": "horizontal", "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/FlipImage
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "direction": "horizontal",
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/FlipImage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Compress Image

POST /api/CompressImage 1 token

Compress an image with quality control.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
quality number optional Quality 1-100 (default: 80)
format string optional jpeg, png, webp
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "quality": 75, "format": "jpeg", "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/CompressImage" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "quality": 75, "format": "jpeg", "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""quality"": 75, ""format"": ""jpeg"", ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/CompressImage", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/CompressImage"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "quality": 75, "format": "jpeg", "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/CompressImage
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "quality": 75,
│      "format": "jpeg",
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/CompressImage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Convert Image Format

POST /api/ConvertImage 1 token

Convert an image between formats.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
format string required png, jpeg, webp, tiff, gif
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "format": "webp", "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/ConvertImage" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "format": "webp", "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""format"": ""webp"", ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/ConvertImage", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/ConvertImage"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "format": "webp", "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/ConvertImage
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "format": "webp",
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ConvertImage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Add Image Text Watermark

POST /api/AddImageTextWatermark 1 token

Overlay text watermark on an image.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
text string required Watermark text
options.fontSize number optional Font size (default: 48)
options.color string optional Text color
options.position string optional center, top-left, etc (default: center)
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "text": "DRAFT", "options": {"fontSize": 48, "position": "center"}, "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/AddImageTextWatermark" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "text": "DRAFT", "options": {"fontSize": 48, "position": "center"}, "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""text"": ""DRAFT"", ""options"": {""fontSize"": 48, ""position"": ""center""}, ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/AddImageTextWatermark", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/AddImageTextWatermark"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "text": "DRAFT", "options": {"fontSize": 48, "position": "center"}, "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/AddImageTextWatermark
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "text": "DRAFT",
│      "options": {
│        "fontSize": 48,
│        "position": "center"
│      },
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/AddImageTextWatermark"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Add Image Watermark

POST /api/AddImageWatermark 1 token

Overlay a watermark image on another image.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
watermark string required Base64 watermark image
options.opacity number optional Opacity 0-1 (default: 0.5)
options.position string optional center, tile, etc (default: center)
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "watermark": "<base64-watermark>", "options": {"opacity": 0.5, "position": "center"}, "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/AddImageWatermark" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "watermark": "<base64-watermark>", "options": {"opacity": 0.5, "position": "center"}, "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""watermark"": ""<base64-watermark>"", ""options"": {""opacity"": 0.5, ""position"": ""center""}, ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/AddImageWatermark", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/AddImageWatermark"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "watermark": "<base64-watermark>", "options": {"opacity": 0.5, "position": "center"}, "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/AddImageWatermark
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "watermark": "\u003Cbase64-watermark\u003E",
│      "options": {
│        "opacity": 0.5,
│        "position": "center"
│      },
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/AddImageWatermark"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Extract EXIF Data

POST /api/ExtractExifData 1 token

Extract EXIF metadata from an image.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
Request Example
JSON
{"image": "<base64-image>"}
Response Example
JSON
{"exif": {"make": "Canon", "model": "EOS R5", "dateTime": "2026:01:15 10:30:00"}}
Code Examples
curl -X POST "https://docbutterfly.com/api/ExtractExifData" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>"}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/ExtractExifData", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/ExtractExifData"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>"}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/ExtractExifData
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E"
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ExtractExifData"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Remove EXIF Data

POST /api/RemoveExifData 1 token

Strip all metadata from an image.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/RemoveExifData" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/RemoveExifData", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/RemoveExifData"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/RemoveExifData
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/RemoveExifData"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Clean Document Image

POST /api/CleanDocumentImage 1 token

Clean and enhance scanned document images.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
sharpen boolean optional Apply sharpening (default: true)
normalize boolean optional Normalize contrast (default: true)
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "sharpen": true, "normalize": true, "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/CleanDocumentImage" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "sharpen": true, "normalize": true, "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""sharpen"": true, ""normalize"": true, ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/CleanDocumentImage", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/CleanDocumentImage"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "sharpen": true, "normalize": true, "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/CleanDocumentImage
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "sharpen": true,
│      "normalize": true,
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/CleanDocumentImage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Clean Photo

POST /api/CleanPhoto 1 token

Auto-enhance photo brightness, contrast, and color.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/CleanPhoto" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/CleanPhoto", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/CleanPhoto"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/CleanPhoto
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/CleanPhoto"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Auto-Rotate Image

POST /api/RotateImageExif 1 token

Auto-rotate based on EXIF orientation data.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
returnBase64 boolean optional Return base64 (default: true)
Request Example
JSON
{"image": "<base64-image>", "returnBase64": true}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "width": 800, "height": 600, "size": 20481}
Code Examples
curl -X POST "https://docbutterfly.com/api/RotateImageExif" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>", "returnBase64": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>"", ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/RotateImageExif", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/RotateImageExif"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>", "returnBase64": true}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/RotateImageExif
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E",
│      "returnBase64": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/RotateImageExif"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Convert Image to PDF

POST /api/ConvertImageToPdf 1 token

Turns JPEG and PNG images into a PDF — one page per image, in the order supplied. A batch of scanned pages becomes a single document.

JPEG and PNG only. HEIC/HEIF is detected and refused with a message saying so — the Linux sharp build we run bundles libheif AV1-only, so an iPhone HEIC cannot be decoded. Convert it to JPEG first.
Parameters
NameTypeRequiredDescription
images array required Array of base64-encoded JPEG or PNG images (max 200 per call, 64 MB decoded in total). Use "image" instead for a single file
image string optional A single base64-encoded JPEG or PNG — the convenience form of "images"
pageSize string optional "fit" makes each page the image's own size at "dpi" (nothing is scaled). Any named paper size instead scales the image to fit inside the page minus "margin", centered, aspect preserved (default: fit)
orientation string optional Page orientation. "landscape" puts the long edge horizontal. Omit to keep the size's own orientation (portrait for every named size except Ledger)
dpi number optional Pixels per inch used to size the page (1-2400) (default: 96)
margin number optional Margin in points around the image. Only valid with a named pageSize — with "fit" the page IS the image, so a margin is refused (default: 0)
Request Example
JSON
{"images": ["<base64-jpeg>", "<base64-png>"], "pageSize": "fit", "dpi": 96}
Response Example
JSON
{"success": true, "pdf": "JVBERi0xLjcK...", "pageCount": 2, "formats": ["jpeg", "png"]}
Code Examples
curl -X POST "https://docbutterfly.com/api/ConvertImageToPdf" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"images": ["<base64-jpeg>", "<base64-png>"], "pageSize": "fit", "dpi": 96}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""images"": [""<base64-jpeg>"", ""<base64-png>""], ""pageSize"": ""fit"", ""dpi"": 96}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/ConvertImageToPdf", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/ConvertImageToPdf"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"images": ["<base64-jpeg>", "<base64-png>"], "pageSize": "fit", "dpi": 96}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/ConvertImageToPdf
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "images": [
│        "\u003Cbase64-jpeg\u003E",
│        "\u003Cbase64-png\u003E"
│      ],
│      "pageSize": "fit",
│      "dpi": 96
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ConvertImageToPdf"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Convert TIFF to PDF

POST /api/ConvertTiffToPdf 1 token

Turns a multi-page TIFF — including the CCITT G3/G4 that inbound faxes arrive as — into a PDF with every page present. A multi-page TIFF previews as page 1 only in Outlook and most mail clients, which reads as a dropped attachment when every page was there all along.

Pages are losslessly re-encoded as PNG, not carried across as their original CCITT strips — the claim is "every page, visually identical", not "the original G4 bytes". A JPEG or PNG sent here is refused with a pointer to Convert Image to PDF.
Parameters
NameTypeRequiredDescription
tiff string required Base64-encoded TIFF (max 64 MB decoded)
pages string optional Which pages to convert: "1-3,5" or an array of 1-based page numbers (max 200 converted per call). Omit for every page (default: all)
pageSize string optional "fit" makes each page the image's own size at "dpi". Any named paper size instead scales each page to fit inside it minus "margin", centered (default: fit)
orientation string optional Page orientation. "landscape" puts the long edge horizontal. Omit to keep the size's own orientation (portrait for every named size except Ledger)
dpi number optional Pixels per inch used to size the page. Defaults to the TIFF's own resolution tag when it has one, otherwise 200 (the fax norm) (default: 200)
margin number optional Margin in points. Only valid with a named pageSize (default: 0)
Request Example
JSON
{"tiff": "<base64-tiff>", "pageSize": "fit", "dpi": 200}
Response Example
JSON
{"success": true, "pdf": "JVBERi0xLjcK...", "pageCount": 4, "sourcePages": 4, "dpi": 200}
Code Examples
curl -X POST "https://docbutterfly.com/api/ConvertTiffToPdf" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"tiff": "<base64-tiff>", "pageSize": "fit", "dpi": 200}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""tiff"": ""<base64-tiff>"", ""pageSize"": ""fit"", ""dpi"": 200}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://docbutterfly.com/api/ConvertTiffToPdf", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://docbutterfly.com/api/ConvertTiffToPdf"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"tiff": "<base64-tiff>", "pageSize": "fit", "dpi": 200}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://docbutterfly.com/api/ConvertTiffToPdf
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "tiff": "\u003Cbase64-tiff\u003E",
│      "pageSize": "fit",
│      "dpi": 200
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ConvertTiffToPdf"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed