When you need to convert JPG to BMP
JPEG is everywhere, yet some software still insists on BMP: older Windows programs, industrial and lab equipment, CNC and laser engraving tools, game modding pipelines and many embedded projects that drive small LCD or e-paper displays. BMP is attractive there precisely because it is simple: a short header followed by raw pixel data, so a microcontroller can read it without a JPEG decoder. This JPG to BMP converter produces exactly that kind of file.
What the output looks like
- Format: Windows BMP with the common 40-byte BITMAPINFOHEADER.
- Color depth: 24 bits per pixel (8 bits each for blue, green and red), no palette.
- Compression: none (BI_RGB), with rows padded to multiples of 4 bytes as the format requires.
- Row order: bottom-up, the standard for BMP files.
- Resolution tag: 72 DPI.
This is the most widely supported flavor of BMP, readable by virtually every program and library that handles bitmaps.
Expect a much larger file
An uncompressed bitmap needs width × height × 3 bytes. A 12-megapixel phone photo (4000 × 3000) becomes about 36 MB as a BMP, even if the JPEG was only 3 MB. That is normal. If the target device has a small screen, shrink the image first with the image resizer, which can output BMP directly at the exact pixel size you need, for example 320 × 240.
Quality
BMP stores the decoded JPEG pixels losslessly, so the bitmap looks exactly like the JPEG, including any existing compression artifacts. Nothing is improved and nothing further is lost. EXIF metadata (camera, date, GPS) is not written to the bitmap.
Colors and gamma
The pixel values are written exactly as the browser decodes them in the sRGB color space. Displays with different gamma or color depth may render them slightly differently, which is normal for small embedded screens.
Tips for embedded projects
- Match the display resolution exactly to avoid scaling on the device.
- Some displays want 16-bit (RGB565) or 1-bit images. Use the 24-bit BMP as a clean intermediate and let your conversion script or library reduce the color depth.
- Check whether your code expects bottom-up rows; most BMP loaders handle it, but minimal hand-written parsers sometimes assume top-down order.
For the reverse conversion, use BMP to JPG. If lossless but compact storage is the goal, JPG to PNG is a better choice than BMP.
The image is decoded and re-encoded by your own browser using the canvas API. It is never uploaded, so private photos and screenshots stay on your device.
Converting many files outside the browser
For a folder of photos, the same 24-bit output can be produced from the command line or a script:
# ImageMagick: BMP3 writes the classic 40-byte header
magick photo.jpg -type TrueColor BMP3:photo.bmp
# Python with Pillow
from PIL import Image
Image.open("photo.jpg").convert("RGB").save("photo.bmp")The BMP3: prefix matters for older software. Without it, ImageMagick may write a newer BMP version with extended headers that some legacy readers and microcontroller libraries reject.