Georgia Ingham Georgia is a Java Developer. She has spoken at lots of conferences. Her hobbies include reading, completing puzzle books and cycling.

How to write BMP images in Java (Tutorial)

55 sec read

BMP icon

In this article, we will show you how to write BMP images in Java. We also have a related article covering how to read BMP files in Java.

ImageIO can write out images as BMP files but has limited control over the process or the output. So we added the ability to write out images as BMP files with JDeli. In this article, we show you how to use either JDeli or ImageIO.

How to write out an image as a BMP file in ImageIO

  1. Create a File (or OutputStream) object
  2. Pass image, BMP type and File (or OutputStream) object into write method

and the Java code to write BMP with ImageIO…

File file = new File("/path/to/image.bmp");
ImageIO.write(bufferedImage, "BMP", file);

Note you can easily switch to JDeli and replace ImageIO by just changing ImageIO.write to JDeli.write.

How to write out an image as a BMP file with JDeli

  1. Add JDeli to your class or module path. (download link to the trial jar).
  2. Create a File (or OutputStream) object
  3. Pass image, BMP type and File (or OutputStream) object into write method

and the Java code to write BMP with JDeli…



Are you a Java Developer working with Image files?

Why do developers choose JDeli over free alternatives?

  1. Works with newer image formats such as AVIF, HEIC, JPEG XL, WEBP
  2. Better support than alternatives for JPEG, PNG, TIFF.
  3. Prevent JVM crashes caused by native code in other image libraries
  4. Better performance than other popular Java image libraries
Georgia Ingham Georgia is a Java Developer. She has spoken at lots of conferences. Her hobbies include reading, completing puzzle books and cycling.