With ImageIO, instead of Image you use BufferedImage which is a subclass of Image, and can thus be used in any of the familiar tools that work with Images. Introduced with Java 1.4.
| raw bytes ⇒ BufferedImage | URL ⇒ BufferedImage |
| Image ⇒ raw bytes | Image ⇒ BufferedImage |
| File ⇒ BufferedImage | Learning More |
| BufferedImage ⇒ File | Links |
// file to BufferedImage import java.awt.image. BufferedImage; import java.io.File; import javax.imageio.ImageIO; ... BufferedImage image = ImageIO.read( new File( "rabbit.jpg" ) );
JAI has a set of
for the much simpler ImageIO class, that will for example let you process TIFF files with ImageIO.![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.17] | ![]() | ||
| You are visitor number 40,654. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/Mindprod website mirror) | ||
| http://mindprod.com/jgloss/imageio.html | J:\mindprod\jgloss\imageio.html | ||