Class ImageProcessing
java.lang.Object
de.iip_ecosphere.platform.kiServices.functions.images.ImageProcessing
Utility class for the processing of images.
- Author:
- Alexander Weber, SSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImagegrayScaleImage(BufferedImage bufferedImage) Gray scales a BufferedImage.static BufferedImagerescaleImage(BufferedImage image, int targetHeight, int targetWidth) To shrink the pixelcount in an image without changing its content.static BufferedImagethresholdImage(BufferedImage image, int threshold) Converts an image to a binary one based on given threshold.
-
Constructor Details
-
ImageProcessing
public ImageProcessing()
-
-
Method Details
-
grayScaleImage
Gray scales a BufferedImage.- Parameters:
bufferedImage- The image to be converted.- Returns:
- The original image as gray scale.
-
thresholdImage
Converts an image to a binary one based on given threshold. A lower threshold will result in more of the image being completely white.- Parameters:
image- the bufferedimage to convert.threshold- the threshold in [0,255]- Returns:
- a new BufferedImage instance of TYPE_BYTE_GRAY with only 0'S and 255's
-
rescaleImage
To shrink the pixelcount in an image without changing its content.- Parameters:
image- The image to rescale.targetHeight- The pixel hight it should have.targetWidth- The pixel width it should have.- Returns:
- A smaller version of the original image.
-