public class BufferedImageUtils extends Object
BufferedImages.| Modifier and Type | Method and Description |
|---|---|
static int |
countDistictColors(BufferedImage image)
Returns the number of distinct colors (excluding transparency) in the
image. |
static void |
drawImage(BufferedImage image,
BufferedImage canvas,
int x,
int y)
Draws
image |
static int[] |
getDistictColors(BufferedImage image)
Returns the
image's distinct colors in an RGB format, discarding
transparency information. |
static int[] |
getDistictColors(BufferedImage image,
int padding)
Returns the
image's distinct colors in an RGB format, discarding
transparency information. |
static int[][] |
getRgb(BufferedImage image)
Returns a two dimensional array of the
image's RGB values, including
transparency. |
static boolean |
hasPartialTransparency(BufferedImage image)
Returns
true if the provided image has partially transparent areas
(alpha channel). |
static boolean |
hasTransparency(BufferedImage image)
Returns
true if the provided image has any kind of transparent areas |
static BufferedImage |
matte(BufferedImage source,
Color matteColor)
Performs matting of the
source image using matteColor. |
public static boolean hasPartialTransparency(BufferedImage image)
true if the provided image has partially transparent areas
(alpha channel).public static boolean hasTransparency(BufferedImage image)
true if the provided image has any kind of transparent areaspublic static int countDistictColors(BufferedImage image)
image.public static int[] getDistictColors(BufferedImage image)
image's distinct colors in an RGB format, discarding
transparency information.public static int[] getDistictColors(BufferedImage image, int padding)
image's distinct colors in an RGB format, discarding
transparency information. Adds padding empty slots at the beginning of
the returned array.public static int[][] getRgb(BufferedImage image)
image's RGB values, including
transparency.public static BufferedImage matte(BufferedImage source, Color matteColor)
source image using matteColor.
Matting is rendering partial transparencies using solid color as if the original
image was put on top of a bitmap filled with matteColor.public static void drawImage(BufferedImage image, BufferedImage canvas, int x, int y)
image on the canvas placing the top left corner of
image at x / y offset from the top left
corner of canvas.Copyright © 2013 Carrot Search s.c.. All Rights Reserved.