Skip to content
pdfconversionapi

BMP to WebP API

POST a BMP to /v2/convert/bmp/to/webp and get a lossless WebP (VP8L) with the bitmap's exact pixels. It is the smallest lossless format this API writes for the sample, under 4% of the BMP's size.

Endpoint
POST /v2/convert/bmp/to/webp
Accepts
bmp
Sample timing
1 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/bmp/to/webp \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@shelf-label.bmp \
  -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
fi
200 OK1 ms median1 file, 11 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.001,
  "Files": [
    {
      "FileName": "shelf-label.webp",
      "FileExt": "webp",
      "FileSize": 11110,
      "FileData": "UklGRl4rAABXRUJQVlA4TFIr…"
    }
  ]
}

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.

First page of shelf-label.webp, rendered by the API
Input
shelf-label.bmp (293 KB)
Output
shelf-label.webp (11 KB)
Source
A 24-bit warehouse bin label with a QR code and a colored header, drawn by us for this page. (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.

ParameterWhat it does
ImageWidthintegerWidth after scaling. Halving the label to 200 × 125 raised the size to 13,860 bytes: lossless coding has to store every new blended color that resampling creates.Values: 1–16384
ImageHeightintegerHeight after scaling; 100 gave 160 × 100 and 10,300 bytes.Values: 1–16384
ScaleProportionsboolean, default truefalse stretches to both values exactly.
ScaleIfLargerboolean, default falsetrue stops the bitmap from being enlarged.
ScaleImageboolean, default truefalse crops the top-left area: 150 × 100 came to 2,160 bytes.
TransparentColorstringClears every pixel of this color; #FFFFFF removed the label's white background and the QR code's light modules, and also 465 pixels inside the white "BIN A-14-03" lettering of the header (11,994 bytes).Values: Color name, #RRGGBB or R,G,B
ColorSpaceenum, default defaultGray values gave 6,162 bytes and black-and-white 2,062. cmyk returns 400.Values: default, rgb, gray, monochrome
ImageQualityinteger, default 75Only 75, ConvertAPI's documented default, is accepted, because the output is always lossless.
FileNamestringName of the WebP without extension.
StoreFileboolean, default falseSend back a link valid 3 hours.

Not supported yet

Setting one of these to anything but its default returns 400.

OptionWhat to do instead
ImageQualityAny value other than 75 returns 400 "ImageQuality is not supported yet for BMP → WebP".

What carries over, and what doesn't

Kept

  • Every pixel: decoded again, the WebP matched the BMP exactly
  • Fine text and the QR code, since nothing is approximated
  • Opacity: the label's WebP sets no alpha flag and decodes as plain RGB
  • Alpha from 32-bit BMPs that have an alpha mask

Lost or not yet supported

  • The resolution stored in the BMP; WebP output here has no DPI.
  • Lossy compression as a choice: photos saved as BMP stay lossless and much larger than a lossy WebP would be.

Limits

  • One bitmap per request.
  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
  • Bitmaps declaring over 100,000,000 pixels: 413.
  • Each WebP side can be at most 16,384 px. A 16,385 × 2 BMP returned 413 "WebP images can be at most 16,384 pixels on a side, and this one is 16,385×2", while the 16,384 × 2 one converted. Resize values from 16,385 to 20,000 pass validation, then fail when the other side stays small: ImageWidth=20000, ImageHeight=2 and ScaleProportions=false returned 413 with "; lower ImageWidth or ImageHeight" added to the message. With proportions kept, ImageWidth=16385 makes the label 16,385 × 10,241, so the 413 names the 100,000,000-pixel limit instead, with the same hint.
  • Conversions are stopped after 120 seconds (504).

Where teams use it

Serving bitmap graphics on the web

Interface screenshots, diagrams and labels stored as BMP become small WebP files that browsers display, with no loss of detail in text or QR codes.

Shrinking stored bitmaps

Archives of BMP screenshots or scans take a fraction of the space as lossless WebP, and the original pixels can always be recovered.

Questions

Is BMP to WebP lossy or lossless?

Lossless. The API writes the VP8L lossless form of WebP; there is no lossy mode yet, which is why ImageQuality is refused unless it is 75.

How does it compare with PNG?

For the label, the WebP was 11,110 bytes and the PNG from the same API 19,990 bytes, both with identical pixels.

Will a 1-bit BMP stay small?

It is stored as full color, but lossless WebP copes well with two colors: a 1-bit version of the label came to 10,304 bytes.

Convert your first BMP file in a minute.