next up previous
Next: Applets Up: Java's Image Processing Previous: Pixel Independent Operations

Single Pixel vs. Neighborhood Operations

JAVA has optimized single-pixel operations by giving the user the option to directly filter the colormap (a fast and global operation) instead of working with image pixels. However, in neighborhood operations we can no longer simply modify the colormap as with pixel operations. A more general solution is to produce new data for a standard colormap. The most straightforward way to achieve this is to convert the image into an array of numbers which can then be processed as desired. For this purpose, the PixelGrabber class is used. This class implements the ImageConsumer interface and is used to extract a requested rectangular array of pixels from an Image object. These pixels are stored in a one-dimensional array of integers in the RGB format described earlier.



Bob Fisher
Fri Jul 4 16:11:50 BST 1997