TL;DR:
Java’s ImageIO can write BMP files but gives you almost no control over the output. For basic use that is fine. If you need control over bit depth, compression, or other encoder settings, you need an external library. JDeli is a pure Java option that works as a drop-in ImageIO plugin and provides a direct API with full encoder options.
Does Java support BMP natively?
Yes, but only at a basic level. ImageIO can write BMP files without any additional libraries:
File file = new File("/path/to/output.bmp");
ImageIO.write(bufferedImage, "BMP", file);
The limitation is that ImageIO’s BMP writer exposes no encoder options. You cannot control bit depth, colour space, or compression. For many use cases this is acceptable, but if output quality or file size matter, an external library gives you the control ImageIO does not.
Which Java BMP library should you use?
| ImageIO (native) | Apache Imaging | JDeli | |
|---|---|---|---|
| Pure Java (no native binaries) | ✓ | ✓ | ✓ |
| Works as ImageIO plugin | ✓ | ✗ | ✓ |
| Direct API | ✗ | ✓ | ✓ |
| Bit depth control | ✗ | Limited | ✓ |
| Encoder options | ✗ | Limited | ✓ |
| Supports other formats (AVIF, HEIC, JPEG2000, PNG, TIFF, WebP…) | ✗ | ✗ | ✓ |
| Cost | Free | Free | Commercial |
| Support | Community | Apache / community | Included |
Native ImageIO is sufficient for straightforward BMP output where encoder control is not required. Apache Imaging is a reasonable free option if you need more control. JDeli is the better choice for production use or where you need consistent behaviour across multiple image formats.
Option 1: Write BMP with native ImageIO
If you just need to produce a BMP file with no particular constraints, native ImageIO is the simplest route:
File file = new File("/path/to/output.bmp");
ImageIO.write(bufferedImage, "BMP", file);
Option 2: Add controlled BMP output to ImageIO (no code changes)
JDeli registers itself as an ImageIO plugin. Once it is on the classpath, your existing ImageIO.write() calls use JDeli automatically with no code changes required.
Maven
<dependency>
<groupId>com.idrsolutions</groupId>
<artifactId>jdeli</artifactId>
<version>[JDELI_VERSION]</version>
</dependency>
Gradle
implementation 'com.idrsolutions:jdeli:[JDELI_VERSION]'
Alternatively, download the trial jar and add it to your classpath manually. See the ImageIO configuration guide for setup details.
// Your existing ImageIO code — no changes needed
File file = new File("/path/to/output.bmp");
ImageIO.write(bufferedImage, "BMP", file);
Option 3: Write BMP directly with the JDeli API
The JDeli API gives you explicit control over output and does not depend on ImageIO’s plugin registration order.
- Add JDeli to your class or module path. (download the trial jar)
- Create a
FileorOutputStreamfor the output. - Call
JDeli.write()with your image, format, and output target.
// String format
JDeli.write(bufferedImage, "BMP", new File("/path/to/output.bmp"));
// Type-safe enum (preferred)
JDeli.write(bufferedImage, OutputFormat.BMP, new File("/path/to/output.bmp"));
Controlling output with BmpEncoderOptions
For production use, pass a BmpEncoderOptions object to control bit depth and other output settings:
BmpEncoderOptions options = new BmpEncoderOptions();
JDeli.write(bufferedImage, options, new File("/path/to/output.bmp"));
See the JDeli BMP documentation for the full list of encoder options.
Frequently asked questions
Does Java support BMP natively?
Yes, but with limited control. ImageIO can write BMP files without any additional library, but exposes no encoder options. You cannot control bit depth, colour space, or compression without an external library such as JDeli.
What is the BMP format?
BMP (Bitmap Image File) is a raster image format developed by Microsoft. It stores pixel data with minimal compression and is widely supported across Windows applications. BMP files are typically larger than equivalent JPEG or PNG files but require no decoding overhead, making them useful in workflows where processing speed matters more than file size.
What is JDeli?
JDeli is a pure Java image library from IDR Solutions. It has no native binaries, works as both an ImageIO plugin and a standalone API, and supports BMP alongside AVIF, HEIC, JPEG2000, PNG, TIFF, and WebP.
Can I read BMP files in Java with JDeli?
Yes. See our companion article: how to read BMP files in Java.
Is JDeli pure Java?
Yes. JDeli has no native binaries and makes no calls to platform-specific libraries, making it straightforward to deploy on any Java-supported platform including containerised and server environments.
Other useful BMP resources
As experienced Java developers, we help you work with images in Java and bring over a decade of hands-on experience with many image file formats.
Are you a Java Developer working with Image files?
// Read an image
BufferedImage bufferedImage = JDeli.read(avifImageFile);
// Write an image
JDeli.write(bufferedImage, "avif", outputStreamOrFile);// Read an image
BufferedImage bufferedImage = JDeli.read(dicomImageFile);// Read an image
BufferedImage bufferedImage = JDeli.read(heicImageFile);
// Write an image
JDeli.write(bufferedImage, "heic", outputStreamOrFile);// Read an image
BufferedImage bufferedImage = JDeli.read(jpegImageFile);
// Write an image
JDeli.write(bufferedImage, "jpeg", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(jpeg2000ImageFile);
// Write an image
JDeli.write(bufferedImage, "jpx", outputStreamOrFile);
// Write an image
JDeli.write(bufferedImage, "pdf", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(pngImageFile);
// Write an image
JDeli.write(bufferedImage, "png", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(tiffImageFile);
// Write an image
JDeli.write(bufferedImage, "tiff", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(webpImageFile);
// Write an image
JDeli.write(bufferedImage, "webp", outputStreamOrFile);
What is JDeli?
JDeli is a commercial Java Image library that is used to read, write, convert, manipulate and process many different image formats.
Why use JDeli?
To handle many well known formats such as JPEG, PNG, TIFF as well as newer formats like AVIF, HEIC and JPEG XL in java with no calls to any external system or third party library.
What licenses are available?
We have 3 licenses available:
Server for on premises and cloud servers, Distribution for use in a named end user applications, and Custom for more demanding requirements.
How does JDeli compare?
We work hard to make sure JDeli performance is better than or similar to other java image libraries. Check out our benchmarks to see just how well JDeli performs.