PSB to WebP API
Send a .psb to /v2/convert/psb/to/webp and get a lossless WebP back in the JSON. The banner sample needs no options: 384 × 128 pixels in 16,340 bytes, about a third of the 47,095-byte 16-bit PNG the same file gives.
- Endpoint
- POST /v2/
convert/ psb/ to/ webp - Accepts
- psb
- Sample timing
- 88 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/psb/to/webp \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@ridge-loop-trail-banner.psb \
-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/psb/to/webp",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("ridge-loop-trail-banner.psb", "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 = "ridge-loop-trail-banner.psb";
form.append("File", new Blob([await readFile(file)]), file);
const url = "https://api.pdfconversionapi.com/v2/convert/psb/to/webp";
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.088,
"Files": [
{
"FileName": "ridge-loop-trail-banner.webp",
"FileExt": "webp",
"FileSize": 16340,
"FileData": "UklGRsw/AABXRUJQVlA4TL8/…"
}
]
}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
- ridge-loop-trail-banner.psb (171 KB)
- Output
- ridge-loop-trail-banner.webp (16 KB)
- Source
- A layered trail-map banner we drew for this site: 384 x 128 pixels at 16 bits per channel on an opaque Background layer, with seven layers including a smooth sky gradient and a hidden old route. Written in the large document (PSB) format by our own script from the published file format specification. (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 | Width of the WebP. Needed for documents wider than 16,384 px: a 40,000 px test PSB converted with ImageWidth=16384 and returned 413 without it. 192 gave the banner in 8,434 bytes.Values: 1–20000 |
ImageHeightinteger | Height of the WebP; the same 16,384 px ceiling applies to tall documents.Values: 1–20000 |
ScaleProportionsboolean, default true | false allows a stretched result at the exact width and height. |
ScaleIfLargerboolean, default false | With true, a document already inside the requested size is left alone. |
ScaleImageboolean, default true | false crops from the top-left corner rather than scaling. |
ColorSpaceenum, default default | gray gave 6,632 bytes and monochrome 748 bytes for the banner.Values: default, rgb, gray, monochrome; cmyk returns 400 |
TransparentColorstring | One exact color becomes clear. #FFFFFF cleared the 295 pixels that are pure white, the core of the label and markers, while their softer edges stayed opaque (17,480 bytes).Values: #RRGGBB, R,G,B or a color name |
FileNamestring | Name of the result without extension; defaults to the upload's. |
StoreFileboolean, default false | true swaps the base64 data for a link that expires after 3 hours. |
What carries over, and what doesn't
Kept
- Every merged pixel, losslessly: each value equals the 16-bit document rounded to 8 bits
- The visible layers only; the sample's hidden Old route is not drawn
- A file smaller than the 16-bit PNG: 16,340 bytes against 47,095
Lost or not yet supported
- The 16-bit depth. WebP stores 8 bits per channel, so the banner's 2,056 distinct 16-bit colors become 1,421; the sky gradient's 128 rows still get 128 different colors.
- Layers, the 150 ppi setting and any color profile.
- Very large sides. Past 16,384 px the request returns 413 instead of being scaled for you.
Limits
- One PSB per request.
- Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
- WebP width and height at most 16,384 px. A 40,000 × 120 PSB returned 413 'WebP images can be at most 16,384 pixels on a side, and this one is 40,000×120'. With
ImageWidth=16385the banner, then 16,385 × 5,462, got the same kind of 413, which also asks for a lowerImageWidthorImageHeight. - 100,000,000 pixels at most after flattening, or 413.
- 120 seconds per conversion, then 504.
- Type layers, smart objects and layer effects in PSB files are not tested yet.
Where teams use it
Panoramas and long banners on a web page
Wide artwork kept as PSB can go on a page as WebP. The WebP is a fraction of the size and keeps every pixel of the 8-bit result, so a gallery or landing page can show the real thing.
One web format for every upload
If your site already serves WebP, convert PSB uploads straight to it instead of going through PNG; set ImageWidth at the width your layout uses.
Questions
Can I set a WebP quality?
No. The WebP is always lossless. On this route ImageQuality is not refused, it is ignored: 50 returned the same 16,340 bytes. (The PSD to WebP route refuses any value but 75, because ConvertAPI documents the option there.)
My PSB is wider than 16,384 pixels. What do I send?
Add ImageWidth=16384 or less. A 40,000 × 120 test PSB returned 413 on its own, with a message that names the limit and its 40,000×120 size, and converted to 16,384 × 49 with the width set.
Do I lose color going from 16 to 8 bits?
Each value is rounded to the nearest 8-bit step, and nothing else changes. In one column of the sample's sky, the 30 rows that differ at 16 bits still differ after rounding.
Convert your first PSB file in a minute.