Skip to content
pdfconversionapi

JPG to BMP API

Send a JPEG to POST /v2/convert/jpg/to/bmp and the bitmap comes back base64-encoded in the JSON. Nothing in it is compressed: three bytes per pixel, so the 25,110-byte sample photo becomes 360,054 bytes at its full 400 × 300 size.

Endpoint
POST /v2/convert/jpg/to/bmp
Accepts
jpg
Sample timing
5 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/jpg/to/bmp \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@trailhead-sign.jpg \
  --form-string ImageWidth=320 \
  -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 OK5 ms median1 file, 225 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.005,
  "Files": [
    {
      "FileName": "trailhead-sign.bmp",
      "FileExt": "bmp",
      "FileSize": 230454,
      "FileData": "Qk02hAMAAAAAADYAAAAoAAAA…"
    }
  ]
}

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 trailhead-sign.bmp, rendered by the API
Input
trailhead-sign.jpg (25 KB)
Output
trailhead-sign.bmp (225 KB)
Source
A drawn mountain trailhead with a wooden sign and a QR code, made by us for these pages and saved at JPEG quality 92 with an EXIF block, an sRGB color profile and 300 dpi. (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
ImageWidthintegerBitmap width in pixels; the height follows the photo's shape. The sample sends 320, so the 400 × 300 sign arrives as a 320 × 240 bitmap of 230,454 bytes.Values: 1–20000
ImageHeightintegerBitmap height in pixels. ImageHeight=150 on its own gives 200 × 150. Sent with ImageWidth, the pair is a frame the photo has to fit in, so 200 × 200 still yields 200 × 150.Values: 1–20000
ScaleProportionsboolean, default truefalse stretches the photo to exactly ImageWidth × ImageHeight (200 × 200 really comes back 200 × 200), for a panel with a fixed grid. Without a size it has no effect.
ScaleIfLargerboolean, default falseShrink-only mode. With true, asking for 800 px wide returns the 400 × 300 original instead of an 800 × 600 bitmap that would weigh 1,440,054 bytes.
ScaleImageboolean, default truefalse cuts instead of scaling: ImageWidth=160 and ImageHeight=140 keep the 160 × 140 pixels at the top-left corner. It also takes 1/0, yes/no and on/off; any other value, such as maybe, is a 400.
ImageInterpolationboolean, default falseAccepted with either value, because every resize already uses a Lanczos3 filter: the 320 px sample came back byte-identical with true, false or nothing. A value such as maybe returns 400.
ImageResolutionintegerDPI written into the bitmap header as pixels per metre (300 becomes 11,811). Pixels are not resampled. Left out, both header fields stay 0.Values: 10–800
ColorSpaceenum, default defaultgray and monochrome change the pixel values only; monochrome leaves just black and white. The bitmap stays 24-bit at the same 360,054 bytes.Values: default, rgb, gray, monochrome; cmyk returns 400
FileNamestringName for the bitmap, extension added for you. Without it, trailhead-sign.jpg returns as trailhead-sign.bmp.
StoreFileboolean, default falsetrue puts a download link in Files[].Url (valid for 3 hours) where the base64 FileData would be, which keeps half-megabyte bitmaps out of the JSON.

What carries over, and what doesn't

Kept

  • Every decoded pixel at full size: with no ImageWidth, the bitmap's colors matched our own JPEG decode of the sample exactly, with no second compression pass (the 320 px sample is resampled)
  • The 4:3 shape when one side is given (400 × 300 to 320 × 240)
  • The upright view of phone photos: a 300 × 200 test photo tagged EXIF Orientation 6 came back as a 200 × 300 bitmap, turned as the tag says
  • 8 bits per channel of color
  • Any DPI you pass in ImageResolution

Lost or not yet supported

  • Size. At 400 × 300 the bitmap is 360,054 bytes, about 14 times the 25,110-byte JPEG.
  • The JPEG's own 300 dpi. The bitmap header says 0 unless you send ImageResolution.
  • The 588-byte sRGB color profile and the 138-byte EXIF block. The bitmap uses the basic 40-byte info header, which has no color space field and no room for a profile or EXIF.

Limits

  • One JPEG per request; a second file gets a 400.
  • Uploads up to 10 MB on the Free plan or 100 MB on paid plans per request.
  • Decoded images may hold up to 100,000,000 pixels. A 12,000 × 9,000 JPEG returned 413 before decoding started.
  • Resize targets between 1 and 20,000 px on each side.
  • Each conversion gets 120 seconds.

Where teams use it

Software that only opens .bmp

Some older desktop tools and display toolchains take bitmaps and nothing else. Convert the camera JPEG on upload and they receive a file with no decoder step at all.

A frame at a panel's exact resolution

When a small screen is fed bitmaps of exactly its pixel count, ImageWidth=320, ImageHeight=240 and ScaleProportions=false produce that frame in the same request. The 4:3 sample needs no stretching to get there.

A decoded reference copy of a JPEG

Because the BMP carries the decoded pixels untouched, it works as a reference when you compare JPEG decoders or check what an upload looked like before your own processing.

Questions

Why is the BMP so much bigger than my JPEG?

The bitmap stores raw pixels at three bytes each plus a 54-byte header. The 400 × 300 sample is 120,000 pixels, so 360,054 bytes, against 25,110 for the JPEG. Shrinking with ImageWidth is the only lever: 320 × 240 is 230,454 bytes.

Is the BMP 24-bit or 32-bit?

24-bit. A JPEG has no transparency, so every bitmap from this route has the basic 40-byte info header, 24 bits per pixel, no compression and no bit masks. ColorSpace=gray and monochrome change the colors but keep that layout.

Does ImageQuality do anything here?

No. A bitmap is not compressed, and ImageQuality=10 produced the same bytes as no setting. ConvertAPI documents no options for JPG to BMP, so the API ignores unknown ones on this route rather than refusing them.

Is a sideways phone photo turned upright?

Yes. The API reads the EXIF orientation and turns the pixels before writing, since the bitmap has no tag to carry it. A 300 × 200 test photo tagged Orientation 6 came back as a 200 × 300 bitmap.

How do I keep the print size?

Send ImageResolution with the DPI you want. 300 is stored as 11,811 pixels per metre in both directions, the unit bitmaps use. The pixel count stays the same.

Convert your first JPG file in a minute.