AWT Image Filters

We will discuss implementing image filters in detail in this chapter, but first we must illustrate how to use them. This will afford us the opportunity to explore the image filters provided by the java.awt.image package. It also gives us a chance to examine the interactions between a specific image producer and a specific image consumer—FilteredImageSource and ImageFilter respectively.

The java.awt.image package provides a handful of image filters:

  • AreaAveragingScaleFilter

  • CropImageFilter

  • ReplicateScaleFilter

  • RGBImageFilter

The CropImageFilter crops a rectangular region of an image. Both AreaAveragingScaleFilter and ReplicateScaleFilter scale an image by using different scaling algorithms. The RGBImageFilter is an abstract filter ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.