Home : Course Map : Chapter 11 : Java : Supplements :
Image Filters
JavaTech
Course Map
Chapter 11

Introduction
Image Class
Image Loading
  Demo 1 Demo 2  
Pixels/Transparency
  Demo 3
Pixel Handling
  Demo 4  
Demo 5
Exercises

    Supplements
Java 2D Imaging
BufferedImage
Creating Buf.Image
Pixel Handling
  Demo 1 Demo 2
Filters
  Convolutions
     Demo 3
  AffineTransforms
     Demo 4
  LookupTable
     Demo 5 Demo 6
  Rescale
     Demo 7
  Color Conversion
     Demo 8
  Custom
     Demo 9
Exercises
Java Adv Imaging
AWT Flicker:
  Override Update
     Demo 1  Demo 2
  Clipping
     Demo 3
  Double Buffer
     Demo 4

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

The Java 2D API provides a framework for filtering images. That is, a source image enters a filter, the filter processes the image data in some way, and a new image emerges.

Source Image ==> Filter ==> Destination Image

The java.awt.image package includes several filter classes and you can also create your own. The filter classes implement the java.awt.image.BufferedImageOp interface. This interface holds five methods but the crucial one is

  public BufferedImage filter (BufferedImage sourceImg, BufferedImage destImg)

This method will act upon (but not change) the source image and will return the processed version as the destination image. If the destImg argument is not null, then the filter will use this image object to hold the processed image. If it is null, then the filter will create a new image object. In some, but not all filters, the source and destination images can be the same. (This is referred to as in-place filtering.)

The five filtering classes provide with the java.awt.image package include:

  • ConvolveOP – convolution filter that applies a given kernel operator to the image data for effects such as edge detection, sharpening, and other effects.

  • AffineTransformOp – affine transforms, such as translation, scaling, flipping, rotation, and shearing, map 2D structures in one space to another space while maintaining straight lines and the parallelism in the original image.

  • LookupOp – instances of LookupTable are used to map source pixels to destination pixels according to the pixel component values (can’t be used with indexed color model images). Provides color transformation effects such as the inversion of gray scales.

  • RescaleOp – apply a scaling factor to the color components so as to brighten or dim an image.

  • ColorConvertOp – change to a different color space such as converting a color image to a grey scale image.

We discuss each of these in the following sections.

References & Web Resources

 

Latest update: April 17, 2005

              Tech
Fractals
Fractal Drawing
   Demo 1
Fractal Draw Code
Fractal Images
  Demo 2
Image Processing
  Demo 3
Histogram Image
  Demo 4
Exercises

           Physics
Calibration/SysError
SimWithCal/SysErr
  Demo 1
Analysis
  Demo 2
Examples

Exercises

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.