- java.lang.Object
-
- org.omnifaces.utils.image.Images
-
public final class Images extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
computePerceptualHash(BufferedImage image, int size, int base)
https://apiumhub.com/tech-blog-barcelona/introduction-perceptual-hashes-measuring-similarity/static BufferedImage
cropImage(BufferedImage image, double desiredAspectRatio)
static BufferedImage
cropImage(BufferedImage image, int desiredWidth, int desiredHeight)
static BufferedImage
cropToSquareImage(BufferedImage image)
static BufferedImage
grayscale(BufferedImage image)
static BufferedImage
progressiveBilinearDownscale(BufferedImage image, int desiredWidth, int desiredHeight)
static BufferedImage
toBufferedImage(byte[] content)
static byte[]
toJpg(BufferedImage image)
static byte[]
toPng(BufferedImage image)
-
-
-
Method Detail
-
toBufferedImage
public static BufferedImage toBufferedImage(byte[] content) throws IOException
- Throws:
IOException
-
toPng
public static byte[] toPng(BufferedImage image) throws IOException
- Throws:
IOException
-
toJpg
public static byte[] toJpg(BufferedImage image) throws IOException
- Throws:
IOException
-
cropImage
public static BufferedImage cropImage(BufferedImage image, int desiredWidth, int desiredHeight)
-
cropImage
public static BufferedImage cropImage(BufferedImage image, double desiredAspectRatio)
-
cropToSquareImage
public static BufferedImage cropToSquareImage(BufferedImage image)
-
progressiveBilinearDownscale
public static BufferedImage progressiveBilinearDownscale(BufferedImage image, int desiredWidth, int desiredHeight)
-
grayscale
public static BufferedImage grayscale(BufferedImage image)
-
computePerceptualHash
public static String computePerceptualHash(BufferedImage image, int size, int base)
https://apiumhub.com/tech-blog-barcelona/introduction-perceptual-hashes-measuring-similarity/
-
-