Table Of Contents |
Copyright © 1998 IBM Corp. All rights reserved.
Java, JavaBeans and 100% Pure Java are trademarks of Sun Microsystems,
Inc. All other trademarks are the property of their respective owners.
![]() |
Overview |
Image Processing allows the user to manipulate the images to improve the pictorial information for human interpretation. The user can apply standard image processing techniques like Lowpass filtering, Highpass filtering, Edge detection, Histogram equalization, Zooming, Rotation, etc., to achieve a desired effect.
The Image Processing Suite of Beans provides a set of non-visual reusable Java beans which can be easily wired with other beans in various IDEs to create applications. The suite currently provides the following beans :
For detailed explanation on each bean refer to the Bean Usage section below.
The Image Processing Suite of Beans has been designed to be as light as possible and places minimal demands on the system resources.
![]() |
System Requirements |
The Image Processing Suite of Beans is designed to be compliant with 100% Pure Java requirements and will therefore execute on any hardware platform that supports the Java Environment.
Approximately 170 KB of disk space are required to install the ImageProcessing.jar file.
The Image Processing Suite of Beans is designed to work with Java Development Kit Version 1.1 and above.
Any Java application builder (e.g. VisualAge for Java from IBM Corp, VisualCafé from Symantec Corp., JBuilder from Inprise Corp.) that supports JavaBeans may be used to develop applications incorporating this bean.
In order to use the Image Processing Suite of Beans the user needs to have the uicontrols package installed on the user's machine. The uicontrols package may be obtained from the alphaBeans site. The user also has to set the uicontrols.jar file in the CLASSPATH.
![]() |
Installation Instructions |
![]() |
Bean Usage |
There is lot of commonality among Image Processing Suite of Beans. This section describes the common properties, events, methods and wiring instructions for ImageProcessing Suite of beans. The properties, events and methods specific to a bean are described in the specific bean sections.
Following are the significant properties for all ImageProcessing Suite of beans:
Property | Description | Data Type | Attributes* | Default Value | Valid Value |
inputImage | the original image to be processed. | java.awt.Image | W | null | an instance of Image(java.awt. Image) |
result | the processed image. | java.awt.Image | R, B | null | any instance of Image(java.awt. Image) |
imageFilter | filter extending from java.awt. image. ImageFilter to be used with the Filtered ImageSource class in JDK 1.1. | java.awt.image. ImageFilter | R, E | an instance of a class extending from java.awt. image. ImageFilter | an instance of a class extending from java.awt. image. ImageFilter |
autoAction | flag to indicate whether to do the processing whenever the input arguments or the control properties of the bean get changed. | boolean | R,W,B | true | true, false |
debug. | flag to indicate whether IllegalArgument Exception should be thrown if the input property is set to null. If the flag is true and the input property is set to null, IllegalArgument Exception is thrown else the null value is set as the input property. | boolean | R, W, B, E | false | true, false |
* R = read, W = write, B = bound, E = expert
Note:
Control property - R, W, B
Input property - W
Output Property - R, B
The ImageProcessing Suite of beans fire the following events:
This event is fired from within the triggerAction method of the com.ibm.imageprocessing.ImageProcessing class. This event is used to fetch input data from external sources.
Listener Method : fetchArgumentsCalled
This event is fired under two circumstances:
Listener Method: processingStarted, processingOver
This event is fired when the processing finishes successfully. The event object stores the processed image as well as the original image. This is useful in the BeanBox.
Listener Method: imageProcessed
This event is fired as and when the processing is finished, either successfully or not. It can be used to trigger some action on the other beans.
Listener Method: triggerNextActionCalled
This event is fired whenever the old value of the result, autoAction or debug property is different from the new value.
Listener Method: propertyChange
Listener Methods: imageNotLoaded, imageInterrupted, imageFetchAborted.
The ImageProcessing Suite of beans implement the following significant methods:
ProcessingErrorEvent is fired if there is any error in processing an image.
This section describes how any filter bean in this suite can be wired to other beans to build an image processing application. Refer to Figure 1 for the wiring diagram which is applicable to any of the filter beans.
Figure 1 - ImageProcessing bean wiring diagram
This wiring diagram describes how a filter bean can be used with other beans to build an image processing application. This scenario requires a bean that can provide an input to the filter bean. The primary input is an image to be processed. It also expects a trigger (Event) to start the processing by calling the triggerAction method of the filter bean. Just before starting the processing, the filter bean throws the processingStarted event indicating that the image processing has started. Once the processing is over, the filter bean throws the processingOver event again, signifying the completion of the processing.
A concrete scenario is defined as follows:
The wiring diagram consists of a frame containing two image canvases and one button. Also one of the imageprocessing beans is dropped on the design surface. The left image canvas shows the original image and the right one shows the processed image.
Step-by-step wiring instructions are as follows:
Edge Detection is a type of image processing filter. An edge is the boundary between two regions with relatively distinct gray level properties. In some situations, the user needs to detect the outline of a digital image. The Edge Detection filter detects discontinuities in the gray level (intensity of a pixel) of the image thus producing the outline.
Refer to Figure 2 for an example of an image before and after Edge Detection.
Figure 2 - An image before and after Edge Detection
The EdgeDetectionFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The EdgeDetectionFilter bean can be used for detecting the edges or discontinuities in an image. This can be used for images where external representation or outline is significant as compared to the texture or inner details of an image. So, the EdgeDetectionFilter bean can be used in image processing applications for detection of edges in an image.
The most basic image manipulation involves the Lowpass filter. The Lowpass filtering is sometimes called blurring or smoothing. This averages out rapid changes of intensity from one pixel to the next one.
Refer to Figure 3 for an example of an image before and after the Lowpass filtering.
Figure 3 - An image after Low Pass Filtering
Noise in an image varies the values of adjacent pixels even though they were illuminated identically during an exposure. This may effect the image clarity. Suppressing noise helps to improve image clarity.
The LowPassFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. It is used for removing high frequency signals (such as noise in an image) and it has the effect of smoothing the original image.
Transparent images are those that produce a see-through effect so that the background image is visible.
Refer to Figure 4 for an example of a transparent image.
Figure 4 - A Transparent image
The TransparentFilter bean can be used to create transparent images from existing images.
The TransparentFilter bean makes specified colors in the image to appear transparent by setting the transparency coefficients of those pixels to zero. The resultant image when superimposed with another image, the pixels with those colors will produce the see-through effect.
Following are the properties specific to the TransparentFilter bean:
Property | Description | Data Type | Attributes* | Default Value | Valid Value |
colorList | used to specify the transparent colors for the image. | com.ibm. imageprocessing. ColorList | R, W, B | new com.ibm. imageProcessing. ColorList() | new com.ibm. imageProcessing. ColorList() |
* R = read, W = write, B = bound, E = expert
Note:
Control property - R, W, B
Input property - W
Output Property - R, B
The TransparentFilter bean implements the following significant methods:
The BlackAndWhite filtering is the process of converting a colorful image to look like a black and white image.
Refer to Figure 5 for an example of an image before and after BlackAndWhiteFilter.
Figure 5 - An image before and after BlackAndWhiteFilter
The BlackAndWhiteFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The BlackAndWhiteFilter bean can be used to get a black and white picture of a colored image. The red, green and blue components of a pixel are replaced by the average value of these components to give the Black and White effect.
The Colorization filter is the process of retaining only a specified color in an image. All the other colors are removed from the image.
Refer to Figure 6 for an example of an image before and after ColorizationFilter. The red color is specified for colorization.
Figure 6 - An image before and after ColorizationFilter
The ColorizationFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The ColorizationFilter bean gives an effect of looking at the image through glass of a particular color. The bean accepts a color as an input. To give this effect, the bits (rgb components) of a particular pixel are bitwise-anded with the bits of a particular color (chosen as the colorization color).
Following are the properties specific to the ColorizationFilter bean:
Property | Description | Data Type | Attributes* | Default Value | Valid Value |
color | used to specify the color for colorization | java.awt.color | R, W, B | java.awt.Color.red | any instance of java.awt.Color |
* R = read, W = write, B = bound, E = expert
Note:
Control property - R, W, B
Input property - W
Output Property - R, B
The DeColorization filter is the process of removing a specified color from an image. All the other colors of the image are retained.
Refer to Figure 7 for an example of an image before and after DeColorizationFilter. The Blue color is decolorized.
Figure 7 - An image before and after DeColorizationFilter
The DeColorizationFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The bean accepts a color as an input. To give this effect, the bits (rgb components) of a particular pixel are bitwise-anded with the bits of the complement of a particular color (chosen as the decolorization color).
Following are the properties specific to the DeColorizationFilter bean:
Property | Description | Data Type | Attributes* | Default Value | Valid Value |
color | used to specify the color for decolorization | java.awt.color | R, W, B | java.awt.Color.red | any instance of java.awt.Color |
* R = read, W = write, B = bound, E = expert
Note:
Control property - R, W, B
Input property - W
Output Property - R, B
MedianFilter is similar to LowPassFilter. It reduces noise in an image without blurring edges and other sharp details.
Refer to Figure 8 for an example of an image before and after MedianFilter.
Figure 8 - An image before and after MedianFilter
The MedianFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The median filter effect is achieved by replacing the gray level of each pixel by the median of the gray levels in a neighborhood of that pixel.
MirrorFilter gives the mirror reflection of an image.
Refer to Figure 9 for an example of an image before and after MirrorFilter.
Figure 9 - An image before and after MirrorFilter
The MirrorFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. This filter can be used to show a reflected image either along the horizontal axis or vertical axis. The pixel positions are changed to give this effect.
Following are the properties specific to the MirrorFilter bean:
Property | Description | Data Type | Attributes* | Default Value | Valid Value |
axis | Used for setting the X-axis (horizontal) or Y-axis (vertical axis) along which the mirror effect is shown | java.lang.String | R,W,B | Y-axis | Y-axis , "X-axis" |
* R = read, W = write, B = bound, E = expert
Note:
Control property - R, W, B
Input property - W
Output Property - R, B
The events specific to MirrorFilter bean are:
Listener Methods: invalidAxisSet
NegativeFilter gives the negative of an image. Negatives of digital images are useful in numerous applications, such as displaying medical images (X-ray) etc.
Refer to Figure 10 for an example of an image before and after NegativeFilter.
Figure 10 - An image before and after NegativeFilter
The NegativeFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. It gives the same effect as the negative of a photograph. The gray level of each pixel is replaced by the complement of that gray level (i.e. the bits of red, green and blue components of a pixel are complemented).
RotationFilter rotates an image in the steps of 90 degrees. So it can be used to rotate an image by 90, 180, 270 (or any non-negative angle which is a multiple of 90) degrees in the clockwise or anti-clockwise direction.
Refer to Figure 11 for an example of an image before and after RotationFilter.
Figure 11 - An image before and after RotationFilter
The RotationFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The pixel positions are changed to give this effect. This can be used to display vertical text (as image) since Java does not provide an API for vertical text display.
Following are the properties specific to the RotationFilter bean:
Property | Description | Data Type | Attributes* | Default Value | Valid Value |
direction | Used for setting the direction of rotation | java.lang.String | R, W, B | Clockwise | Clockwise , "AntiClockwise" |
rotationAngle | used for setting the angle of rotation to 90, 180, 270 ( or a multiple of 90 or any non-negative angle which is a multiple of 90) degrees | int | R, W, B | 90 | any non-negative angle which is a multiple of 90 |
* R = read, W = write, B = bound, E = expert
Note:
Control property - R, W, B
Input property - W
Output Property - R, B
The events specific to RotationFilter bean are:
An exception is thrown when an invalid argument is passed for the direction and the rotation angle. The exception is caught and this event is thrown. It contains the detailed error message, the message code and the exception.
Listener Methods: invalidRotationAngleSet, invalidDirectionSet
This filter allows the user to scale an image by various zoom factors. Depending on the user's requirement this can enlarge or reduce the image size.
Refer to Figure 12 for an example of an image before and after ZoomFilter.
Figure 12 - An image before and after ZoomFilter
The ZoomFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The bean takes a zoom value as the input, which is specified in percentage. If the value is 100%, the result is the same as the original image. If the value is 50% the resultant image is reduced to half the size of the original image. The pixels in the source image are sampled to produce pixels for an image of a specified size by replicating rows and columns of pixels to scale up or omitting rows and columns of pixels to scale down.
Following are the properties specific to the ZoomFilter bean:
Property | Description | Data Type | Attributes* | Default Value | Valid Value |
zoomFactor | Used for setting the zoom factor. A factor of 100 means the result will be the original image. 200 means the image size will be doubled. | int | R, W, B | 100 | integer greater than zero(>0) |
* R = read, W = write, B = bound, E = expert
Note:
Control property - R, W, B
Input property - W
Output Property - R, B
The specific events to ZoomFilter bean are:
Listener Methods: invalidZoomFactorSet
![]() |
Glossary of Terms |