Package com.mindee.image
Class ImageCompressor
- java.lang.Object
-
- com.mindee.image.ImageCompressor
-
public final class ImageCompressor extends Object
Image compression class.
-
-
Constructor Summary
Constructors Constructor Description ImageCompressor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]compressImage(byte[] imageData)static byte[]compressImage(byte[] imageData, Integer quality)static byte[]compressImage(byte[] imageData, Integer quality, Integer finalWidth)static byte[]compressImage(byte[] imageData, Integer quality, Integer maxWidth, Integer maxHeight)static byte[]compressImage(BufferedImage original, Integer quality, Integer finalWidth, Integer finalHeight)static byte[]encodeToJpegByteArray(BufferedImage image, float quality)static BufferedImageremoveAlphaChannel(BufferedImage original)static BufferedImageresize(BufferedImage inputImage, Integer newWidth, Integer newHeight)
-
-
-
Method Detail
-
resize
public static BufferedImage resize(BufferedImage inputImage, Integer newWidth, Integer newHeight)
-
compressImage
public static byte[] compressImage(byte[] imageData, Integer quality, Integer maxWidth, Integer maxHeight) throws IOException- Throws:
IOException
-
compressImage
public static byte[] compressImage(byte[] imageData, Integer quality, Integer finalWidth) throws IOException- Throws:
IOException
-
compressImage
public static byte[] compressImage(byte[] imageData, Integer quality) throws IOException- Throws:
IOException
-
compressImage
public static byte[] compressImage(byte[] imageData) throws IOException- Throws:
IOException
-
compressImage
public static byte[] compressImage(BufferedImage original, Integer quality, Integer finalWidth, Integer finalHeight) throws IOException
- Throws:
IOException
-
removeAlphaChannel
public static BufferedImage removeAlphaChannel(BufferedImage original)
-
encodeToJpegByteArray
public static byte[] encodeToJpegByteArray(BufferedImage image, float quality) throws IOException
- Throws:
IOException
-
-