Amy Pearson Amy is a Java developer, member of the support team and product manager for JDeli. Out of hours she enjoys gaming and Virtual reality.

How to write BMP images in Java (Tutorial)

1 min 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…


There are several commercial BMP solutions available. Our JDeli Java image library also has BMP support and allows you to read, write and display BMP files.

Are you a Java Developer working with Image files?

Amy Pearson Amy is a Java developer, member of the support team and product manager for JDeli. Out of hours she enjoys gaming and Virtual reality.