In this article, I will be writing about BMP images and how to read them in Java.
What is BMP?
A BMP, bitmap image file, is a file format which stores images. It supports 2d images in monochrome (one colour) and colour. The BMP file format supports 2 file extensions including .bmp and .dib (Device Independant Bitmap). It was primarily designed for Window platforms although it also works on other platforms.
BMP images are popular and can be read by JDeli, ImageIO and JAI.
How to read BMP images in Java?
Here are examples of how BMP images can be read in Java.
BmpDecoder decoder = new BmpDecoder(); BufferedImage image = decoder.read(rawImageBytes);
File bmpFile = new File("bmpImage.bmp"); BufferedImage image = ImageIO.read(bmpFile);
RenderedImage image = JAI.create("fileload", "test1.bmp");
Latest posts by Zain (see all)
- Java 9 JShell explained in 5 minutes - May 11, 2017
- Java 9 Modularity explained in 5 minutes - May 4, 2017
- Key takeaways from NetBeans Day UK 2017 - April 26, 2017
- Why IDRsolutions uses the NetBeans IDE for Java Development - April 18, 2017
- 5 Reasons to Attend NetBeans Day UK 2017 - April 6, 2017