O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required