XCF to BMP API
POST an .xcf to /v2/convert/xcf/to/bmp and get the merged picture as an uncompressed BMP. An opaque canvas like the sample gives 24 bits per pixel after a 54-byte header; a canvas with transparent areas gives 32 bits with alpha after a 122-byte header.
- Endpoint
- POST /v2/
convert/ xcf/ to/ bmp - Accepts
- xcf
- Sample timing
- 45 ms median of 5 runsHow we measure
- Request size
- Up to 10 MB on the Free plan or 100 MB on paid plans, all files together
Request and response
Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.
curl -sS -X POST \
https://api.pdfconversionapi.com/v2/convert/xcf/to/bmp \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@gull-rock-lighthouse.xcf \
-o response.json
# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
mkdir -p converted
name=$(jq -r '.Files[0].FileName' response.json)
jq -r '.Files[0].FileData' response.json \
| base64 --decode > "converted/$name"
else
cat response.json
fiimport base64
import os
import requests
key = os.environ["PDFCONVERSIONAPI_KEY"]
response = requests.post(
"https://api.pdfconversionapi.com/v2/convert/xcf/to/bmp",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("gull-rock-lighthouse.xcf", "rb"))],
timeout=180,
)
result = response.json()
if not response.ok:
raise SystemExit(f"{result['Code']}: {result['Message']}")
os.makedirs("converted", exist_ok=True)
for file in result["Files"]:
path = os.path.join("converted", file["FileName"])
with open(path, "wb") as out:
out.write(base64.b64decode(file["FileData"]))
print(path, file["FileSize"], "bytes")
import { mkdir, readFile, writeFile } from "node:fs/promises";
import { join } from "node:path";
const form = new FormData();
const file = "gull-rock-lighthouse.xcf";
form.append("File", new Blob([await readFile(file)]), file);
const url = "https://api.pdfconversionapi.com/v2/convert/xcf/to/bmp";
const key = process.env.PDFCONVERSIONAPI_KEY;
const response = await fetch(url, {
method: "POST",
headers: { Authorization: `Bearer ${key}` },
body: form,
});
const result = await response.json();
if (!response.ok) {
throw new Error(`${result.Code}: ${result.Message}`);
}
await mkdir("converted", { recursive: true });
for (const file of result.Files) {
const path = join("converted", file.FileName);
await writeFile(path, Buffer.from(file.FileData, "base64"));
console.log(path, file.FileSize, "bytes");
}
{
"ConversionCost": 1,
"ConversionTime": 0.045,
"Files": [
{
"FileName": "gull-rock-lighthouse.bmp",
"FileExt": "bmp",
"FileSize": 360054,
"FileData": "Qk12fgUAAAAAADYAAAAoAAAA…"
}
]
}Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.
The sample, converted
The same file the code sends. Download the input and the output and compare them yourself.

- Input
- gull-rock-lighthouse.xcf (203 KB)
- Output
- gull-rock-lighthouse.bmp (352 KB)
- Source
- A 400 x 300 harbor poster we drew and wrote as a layered XCF file ourselves: 11 layers, including a two-layer group, a layer mask, Multiply and Screen modes and a hidden guide layer. (CC0-1.0). How it was made
- Made by
- 2026-11-04, API build
9eeeb0640aba
Parameters
Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.
| Parameter | What it does |
|---|---|
ImageWidthinteger | Output width. At 200 px the poster's BMP is 200 × 150 and 90,054 bytes, a quarter of the full-size file.Values: 1–20000 |
ImageHeightinteger | Output height, or the second side of a fitting box when sent with ImageWidth.Values: 1–20000 |
ScaleProportionsboolean, default true | false stretches to both sizes exactly. |
ScaleIfLargerboolean, default false | true never enlarges a canvas that is already small enough. |
ScaleImageboolean, default true | false takes the top-left region at the given size, uncut by scaling. |
ColorSpaceenum, default default | gray and monochrome change the pixel values only; the BMP stays 24-bit, so it is still 360,054 bytes.Values: default, rgb, gray, monochrome; cmyk returns 400 |
ImageResolutioninteger | Writes the pixels-per-meter fields of the header. They are 0 by default; 150 gave 5,906 per meter.Values: 10–800 |
FileNamestring | Name of the .bmp without extension; the XCF's name by default. |
StoreFileboolean, default false | true returns a 3-hour download link instead of base64. |
What carries over, and what doesn't
Kept
- Every pixel of the merged layers: decoded, the BMP equals the PNG of the same XCF
- Transparency when the canvas has it: a test XCF with clear areas gave a 32-bit BMP with a 108-byte version 4 header and a 0xFF000000 alpha mask
- The canvas size: 400 × 300 in, 400 × 300 out unless you resize
Lost or not yet supported
- Compression. The 207,799-byte XCF became a 360,054-byte BMP.
- Bit depth above 8 bits per channel; 16-bit XCF files are reduced.
- The XCF's 150 ppi, unless you send
ImageResolution, plus its color profile and layers.
Limits
- One XCF per request. The canvas may hold up to 67,108,864 pixels (8,192 × 8,192): 16,384 × 4,096 converts, 8,193 × 8,192 gets a 422.
- Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
- 120 seconds per conversion, then 504.
- Resize targets from 1 to 20,000 px.
Where teams use it
Splash screens and embedded displays
Firmware tools for small screens and printers often load plain BMP. Artwork drawn in GIMP can be sent as .xcf and dropped into the firmware build as a bitmap.
Older Windows software
Some Windows programs and plug-ins accept only BMP for logos and backgrounds. Converting the layered master directly avoids a manual export from GIMP for each size.
Questions
Why is the BMP so much bigger than the XCF?
The BMP stores every pixel uncompressed. The poster is opaque, so it gets 3 bytes a pixel: 400 × 300 × 3 bytes plus a 54-byte header is exactly the 360,054 bytes we got. The XCF's tiles are run-length compressed.
Do I get a 24-bit or a 32-bit BMP?
That depends on the canvas. A fully opaque one, like the sample, gives 24 bits per pixel with the 40-byte header. Any transparent or partly transparent pixel gives 32 bits with an alpha channel and the version 4 header. There is no option to choose.
Is the BMP bottom-up or top-down?
It has a positive height in the header, the usual bottom-up layout. Readers flip it for you; you only need to care if you parse the pixel array yourself.
Convert your first XCF file in a minute.