Tagged: BufferedImage

java tutorials

Convert BufferedImage to Byte Array in Java

In this example we demonstrate how to convert a BufferedImage to byte[] using standard Java. We use try-with-resources to manage the closing of OutputStream. Convert BufferedImage to Byte Array We create the BufferedImage by...
java tutorials

Convert Image to Black and White using Java

This example demonstrates how to convert an image to Black and White using Java. A 1-bit image is created with an IndexColorModel with two colors in the default sRGB ColorSpace: {0,0,0} and {255,255,255}. Convert...