Skip to content
pdfconversionapi

BMP to GIF API

POST a BMP to /v2/convert/bmp/to/gif and get a single-frame GIF. If the bitmap uses 256 colors or fewer they are kept exactly; otherwise a palette of 256 is computed, as for our 760-color label.

Endpoint
POST /v2/convert/bmp/to/gif
Accepts
bmp
Sample timing
56 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/gif \
  -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 OK56 ms median1 file, 8.6 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.056,
  "Files": [
    {
      "FileName": "shelf-label.gif",
      "FileExt": "gif",
      "FileSize": 8823,
      "FileData": "R0lGODlhkAH6AIAAAAAAAAAA…"
    }
  ]
}

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.gif, rendered by the API
Input
shelf-label.bmp (293 KB)
Output
shelf-label.gif (8.6 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
ColorSpaceenum, default defaultmonochrome gives a two-color GIF (3,650 bytes for the label, QR code still readable); gray a gray palette (237 shades used). cmyk is a 400.Values: default, rgb, gray, monochrome
TransparentColorstringMakes one color the GIF's transparent index. #FFFFFF turned the label's white areas clear.Values: Color name, #RRGGBB or R,G,B
ImageWidthintegerWidth to scale to. At 200 px the label used 181 colors, since resampling adds shades that then compete for the palette.Values: 1–20000
ImageHeightintegerHeight to scale to; with ImageWidth, a box to fit in.Values: 1–20000
ScaleProportionsboolean, default truefalse stretches into the full box.
ScaleIfLargerboolean, default falsetrue never enlarges the bitmap.
ScaleImageboolean, default truefalse crops instead: 150 × 100 gave 2,276 bytes.
FileNamestringName for the GIF, without extension.
StoreFileboolean, default falseReturn a 3-hour URL in place of the data.

What carries over, and what doesn't

Kept

  • Exact colors when the BMP has 256 or fewer: an 8-bit palette version of the label (250 colors) came through with no pixel changed
  • The QR code: it decoded from both the color and the monochrome GIF
  • Transparency from 32-bit BMPs that have an alpha mask, as a transparent index
  • 400 × 250 pixel size unless you resize

Lost or not yet supported

  • Colors beyond 256. The label's anti-aliased text has 760 colors; the GIF has 154, and 2,626 of its 100,000 pixels changed, by at most 24 levels in one channel.
  • Dithering is not applied, so gradients can show bands.
  • The BMP's DPI, since GIF has no field for it.

Limits

  • One BMP per request; the GIF has one frame and no loop setting.
  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
  • Headers that declare over 100,000,000 pixels get a 413.
  • Resize targets from 1 to 20,000.
  • 120-second time limit per conversion.

Where teams use it

Small graphics for old systems

Some intranet pages, embedded web servers and email templates still expect GIF. Logos, icons and labels kept as BMP convert into compact GIFs for them.

Two-color images for printers and displays

With ColorSpace=monochrome, a bitmap becomes a black-and-white GIF suited to thermal printers and simple screens.

Questions

How are colors reduced?

If the bitmap has at most 256 distinct colors, they are written as they are. Above that, a neural-net quantizer picks 256 and each pixel takes the nearest, without dithering.

How small is the GIF?

The 300,054-byte label became 8,823 bytes. A 1-bit version gave a two-color GIF of 6,851 bytes.

Can I make an animated GIF from several BMPs?

No, this route takes one file and writes one frame.

Are unknown options refused?

No. ConvertAPI documents no options for BMP to GIF, so a parameter this route doesn't read, such as ImageQuality, is ignored and the GIF is the same.

Convert your first BMP file in a minute.