public class ImageHelper extends Object
Constructor and Description |
---|
ImageHelper() |
Modifier and Type | Method and Description |
---|---|
static BufferedImage |
cloneImage(BufferedImage bi)
Clones an image.
|
static BufferedImage |
convertImage2Binary(BufferedImage image)
Deprecated.
As of release 1.1, renamed to
convertImageToBinary(BufferedImage image) |
static BufferedImage |
convertImageToBinary(BufferedImage image)
A simple method to convert an image to binary or B/W image.
|
static BufferedImage |
convertImageToGrayscale(BufferedImage image)
A simple method to convert an image to gray scale.
|
static Image |
getClipboardImage()
Gets an image from Clipboard.
|
static BufferedImage |
getScaledInstance(BufferedImage image,
int targetWidth,
int targetHeight)
Convenience method that returns a scaled instance of the provided
BufferedImage . |
static IIOImage |
getScaledInstance(IIOImage iioSource,
float scale)
Convenience method that returns a scaled instance of the provided
IIOImage . |
static BufferedImage |
getSubImage(BufferedImage image,
int x,
int y,
int width,
int height)
A replacement for the standard
BufferedImage.getSubimage
method. |
static BufferedImage |
invertImageColor(BufferedImage image)
Inverts image color.
|
static BufferedImage |
rotateImage(BufferedImage image,
double angle)
Rotates an image.
|
public static BufferedImage getScaledInstance(BufferedImage image, int targetWidth, int targetHeight)
BufferedImage
.image
- the original image to be scaledtargetWidth
- the desired width of the scaled instance, in pixelstargetHeight
- the desired height of the scaled instance, in pixelsBufferedImage
public static IIOImage getScaledInstance(IIOImage iioSource, float scale)
IIOImage
.iioSource
- the original image to be scaledscale
- the desired scaleIIOImage
public static BufferedImage getSubImage(BufferedImage image, int x, int y, int width, int height)
BufferedImage.getSubimage
method.image
- x
- the X coordinate of the upper-left corner of the specified
rectangular regiony
- the Y coordinate of the upper-left corner of the specified
rectangular regionwidth
- the width of the specified rectangular regionheight
- the height of the specified rectangular regionimage
.public static BufferedImage convertImageToBinary(BufferedImage image)
image
- input image@Deprecated public static BufferedImage convertImage2Binary(BufferedImage image)
convertImageToBinary(BufferedImage image)
image
- input imagepublic static BufferedImage convertImageToGrayscale(BufferedImage image)
image
- input imagepublic static BufferedImage invertImageColor(BufferedImage image)
image
- input imagepublic static BufferedImage rotateImage(BufferedImage image, double angle)
image
- the original imageangle
- the degree of rotationpublic static Image getClipboardImage()
public static BufferedImage cloneImage(BufferedImage bi)
bi
- Copyright © 2017 Tess4J. All Rights Reserved.