org.bounce.image
Class ImageUtilities

java.lang.Object
  extended by org.bounce.image.ImageUtilities

public class ImageUtilities
extends Object

A class with utility methods for the images.

Version:
$Revision: 1.5 $, $Date: 2008/01/28 21:28:37 $
Author:
Edwin Dankert

Constructor Summary
ImageUtilities()
           
 
Method Summary
static ImageIcon createBlueImage(ImageIcon image)
          Creates a blue version of the image supplied.
static ImageIcon createBrighterImage(ImageIcon image)
          Creates a 30% brighter version of the image supplied.
static ImageIcon createCyanImage(ImageIcon image)
          Creates a cyan version of the image supplied.
static ImageIcon createDarkerImage(ImageIcon image)
          Creates a 30% darker version of the image supplied.
static ImageIcon createGrayImage(ImageIcon image)
          Creates a gray version of the image supplied.
static ImageIcon createGreenImage(ImageIcon image)
          Creates a green version of the image supplied.
static ImageIcon createMagentaImage(ImageIcon image)
          Creates a magenta version of the image supplied.
static ImageIcon createRedImage(ImageIcon image)
          Creates a red version of the image supplied.
static ImageIcon createSilhouetteImage(ImageIcon image, Color color)
          Creates a silhouette version of the image supplied, in the supplied color.
static ImageIcon createYellowImage(ImageIcon image)
          Creates a yellow version of the image supplied.
static ImageIcon filter(ImageIcon image, RGBImageFilter filter)
          Utility method that filters the image.
static Image iconToImage(Icon icon)
          Converts an Icon to an Image.
static Icon resize(Icon icon, int width, int height)
          Resizes an icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtilities

public ImageUtilities()
Method Detail

createDarkerImage

public static ImageIcon createDarkerImage(ImageIcon image)
Creates a 30% darker version of the image supplied.

Parameters:
image - the image to be darkened.
Returns:
the darker image.

createBrighterImage

public static ImageIcon createBrighterImage(ImageIcon image)
Creates a 30% brighter version of the image supplied.

Parameters:
image - the image to be brightened.
Returns:
the brighter image.

createGrayImage

public static ImageIcon createGrayImage(ImageIcon image)
Creates a gray version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createRedImage

public static ImageIcon createRedImage(ImageIcon image)
Creates a red version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createGreenImage

public static ImageIcon createGreenImage(ImageIcon image)
Creates a green version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createBlueImage

public static ImageIcon createBlueImage(ImageIcon image)
Creates a blue version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createCyanImage

public static ImageIcon createCyanImage(ImageIcon image)
Creates a cyan version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createMagentaImage

public static ImageIcon createMagentaImage(ImageIcon image)
Creates a magenta version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createYellowImage

public static ImageIcon createYellowImage(ImageIcon image)
Creates a yellow version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createSilhouetteImage

public static ImageIcon createSilhouetteImage(ImageIcon image,
                                              Color color)
Creates a silhouette version of the image supplied, in the supplied color.

Parameters:
image - the image to be filtered.
color - the color of the filtered image.
Returns:
the filtered image.

filter

public static ImageIcon filter(ImageIcon image,
                               RGBImageFilter filter)
Utility method that filters the image.

Parameters:
image - the image to be filtered.
filter - the filter to be used.
Returns:
the filtered image.

iconToImage

public static Image iconToImage(Icon icon)
Converts an Icon to an Image.

Parameters:
icon - the icon to convert.
Returns:
image the converted icon.

resize

public static Icon resize(Icon icon,
                          int width,
                          int height)
Resizes an icon.

Parameters:
icon - the icon to resize.
width - the width of the icon or 0 or smaller when the width should be relative to the size of the icon and the provided height. Not both height and width can be smaller than 0.
height - the height of the icon or 0 or smaller when the height should be relative to the size of the icon and the provided width. Not both height and width can be smaller than 0.
Returns:
the resized icon.


Copyright © 2002-2011 Edwin Dankert. All Rights Reserved.