java.lang.Object
org.monte.media.image.Images
Image processing methods for buffered images.
- Author:
- Werner Randelshofer, Karl von Randow
-
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImagecloneImage(RenderedImage rImg) Clone the image.static ImagecreateImage(Class<?> baseClass, String location) static ImagecreateImage(URL resource) static booleanThis method returns true if the specified image has transparent pixelsstatic BufferedImage[]Splits an image into count subimages.static BufferedImagetoBufferedImage(Image image) static BufferedImagetoBufferedImage(RenderedImage rImg) Converts the image to a buffered image.static BufferedImagetoImage(int[] pixels, int width, int height) Converts an array of integer pixels into an image.static BufferedImageConverts the image into a buffered image with an RGB color model.static BufferedImageConverts the image into a buffered image with an RGB color model.static BufferedImagetoIntImage(BufferedImage img) Converts the image into a format that can be handled easier.static int[]toPixels(BufferedImage img) Converts an image into an array of integer pixels.static BufferedImagetoRGBImage(Image img) Converts the image to a buffered image into the sRGB color space.
-
Method Details
-
createImage
-
createImage
-
toRGBImage
Converts the image to a buffered image into the sRGB color space. Preserves the alpha channel of the input image.- Parameters:
img- img- Returns:
- img
-
toImageWithColorModel_usingColorConvertOp
Converts the image into a buffered image with an RGB color model. This method returns the same image, if no conversion is needed.This method should be run with "KCMS" (Kodak Color Management System). The "Little CMS" which is the default in JVMs is 4 times slower.
Start the VM with the following options:
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
- Parameters:
img- an imagecm- the destination color model- Returns:
- the converted image, may be the same as the source image
-
toImageWithColorModel_usingDrawImage
Converts the image into a buffered image with an RGB color model. This method returns the same image, if no conversion is needed.- Parameters:
img- an imagecm- cm destination color model- Returns:
- the converted image, may be the same as the source image
-
toBufferedImage
Converts the image to a buffered image. Returns the same image, if the image is already a buffered image. -
cloneImage
Clone the image. -
toBufferedImage
-
hasAlpha
This method returns true if the specified image has transparent pixelsCode taken from the Java Developers Almanac 1.4 http://javaalmanac.com/egs/java.awt.image/HasAlpha.html
-
split
Splits an image into count subimages. -
toIntImage
Converts the image into a format that can be handled easier. -
toPixels
Converts an image into an array of integer pixels. If the image has an integer data buffer, the internal pixel array is returned. -
toImage
Converts an array of integer pixels into an image. The array is referenced by the image.
-