How to read a image in Java and convert it to buffered image?
In Java, we can use the javax. imageio. ImageIO class to read and write an image.
Java 2D supports loading these external image formats into its BufferedImage format using its Image I/O API which is in the javax. imageio package. Image I/O has built-in support for GIF, PNG, JPEG, BMP, and WBMP.
The Optical Character Recognition (OCR) technology has made it possible to recognize and read the text within the scanned documents and images. OCR lets you convert the read-only text into an editable form.
You need the Java 2D API for this. Here's a Sun tutorial about the subject. In the "Working with Images" chapter you can learn how to read/load an image. Here's an extract of the tutorial:
BufferedImage img = null;
try {
img = ImageIO.read(new File("strawberry.jpg"));
} catch (IOException e) {
}
See ImageIO.read().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With