The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search

Trail: 2D Graphics
Lesson: Manipulating and Displaying Images

Immediate-Mode Imaging with BufferedImage

The immediate-mode imaging model enables you to manipulate and display pixel-mapped images whose data is stored in memory. You can access image data in a variety of formats and use several types of filtering operations to manipulate the data.

BufferedImage is the key class in the immediate-mode imaging API. This class manages an image in memory and provides methods for storing, interpreting, and rendering the pixel data. A BufferedImage can be rendered through either a Graphics or a Graphics2D rendering context.

A BufferedImage is essentially an Image with an accessible data buffer. A BufferedImage has a ColorModel and a Raster of image data.

The ColorModel provides a color interpretation of the image's pixel data. The Raster represents the rectangular coordinates of the image, maintains image data in memory, and provides a mechanism for creating multiple subimages from a single image data buffer. The Raster also provides methods for accessing specific pixels within the image. For information about directly manipulating pixel data and writing filters for BufferedImage objects, see the chapter Imaging in the Java 2D Programmer's Guide.


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search