public class ImaTool extends Object
| Modifier and Type | Method and Description |
|---|---|
static BufferedImage |
awtLoadBufferedImage(File f)
Loads the image from the file into an image.
|
static Image |
awtLoadImage(File f)
Loads the image from the file into an image.
|
static BufferedImage |
awtResize(BufferedImage bi,
int w,
int h)
Resizes a BufferedImage while keeping it's aspect ratio, using the
AWT mechanism...
|
static double |
findQualityBySize(BufferedImage bi,
int sizenear)
Taking a BufferedImage, this function will try to find a JPEG
quality factor that will save the image with a size around the size
specified.
|
static Dimension |
getImageDimension(File resourceFile) |
static Dimension |
getImageDimension(InputStream is) |
static Image |
loadFile_image(File f)
Loads an image from a file.
|
static BufferedImage |
loadFile(File f)
Loads an image from a file.
|
static BufferedImage |
loadGIF(File f)
Load a GIF format image using the BYTE_TYPE_INDEXED format (fastest)
|
static BufferedImage |
loadGIF(File f,
int buffertype)
Load a GIF format image.
|
static BufferedImage |
loadGIF(InputStream is)
Load a GIF format image using the BYTE_TYPE_INDEXED format (fastest)
|
static BufferedImage |
loadGIF(InputStream is,
int buffertype)
Load a GIF format image.
|
static BufferedImage |
loadJPEG(File f)
Loads a JPEG image from a file.
|
static BufferedImage |
loadJPEG(InputStream is)
Loads a JPEG image from a stream.
|
static BufferedImage |
loadPNG(InputStream is) |
static BufferedImage |
loadStream(InputStream is,
String type)
Loads an image from a stream.
|
static void |
main(String[] args) |
static BufferedImage |
makeBuffered(Image i)
Converts an Image into a same-size buffered image if it's not already a
BufferedImage.
|
static BufferedImage |
makeBuffered(Image i,
int bit)
Converts an Image into a same-size buffered image if it's not already a
BufferedImage.
|
static BufferedImage |
resizeFiltered_RAW(BufferedImage i,
int w,
int h) |
static BufferedImage |
resizeFiltered_RAW(BufferedImage bi,
int w,
int h,
ResamplerFilter fil) |
static BufferedImage |
resizeFiltered(BufferedImage i,
int w,
int h)
Resizes a BufferedImage while keeping it's aspect ratio, using the
optimal filtered stuff...
|
static BufferedImage |
resizeFiltered(BufferedImage bi,
int w,
int h,
ResamplerFilter fil)
Resizes a BufferedImage while keeping it's aspect ratio, using the
optimal filtered stuff...
|
static Dimension |
resizeWithAspect(Dimension dest,
Dimension src) |
static Dimension |
resizeWithAspect(int dw,
int dh,
int sw,
int sh)
Does a resize of an object with size (sw, sh) to fit within a rectangle
of (dw, dh) while keeping the same aspect ratio
|
static void |
saveGIF(BufferedImage bi,
File f)
Saves an image as a GIF file to a stream.
|
static void |
saveGIF(BufferedImage bi,
OutputStream os)
Saves an image as a GIF file to a stream.
|
static void |
saveImageByMime(OutputStream os,
BufferedImage bi,
String mime) |
static void |
saveJPEG(BufferedImage bi,
File f,
double qf)
Saves an image as a JPEG to the stream specified, with the quality
spec'd.
|
static void |
saveJPEG(BufferedImage bi,
OutputStream os,
double qf)
Saves an image as a JPEG to the stream specified, with the quality
spec'd.
|
static void |
savePNG(BufferedImage bi,
File f) |
static void |
savePNG(BufferedImage bi,
OutputStream f) |
public static Dimension resizeWithAspect(int dw, int dh, int sw, int sh)
public static BufferedImage makeBuffered(Image i, int bit)
public static BufferedImage makeBuffered(Image i)
public static BufferedImage loadPNG(InputStream is) throws IOException
IOExceptionpublic static BufferedImage loadJPEG(InputStream is) throws IOException
IOExceptionpublic static BufferedImage loadJPEG(File f) throws IOException
IOExceptionpublic static void saveJPEG(BufferedImage bi, OutputStream os, double qf) throws IOException
IOExceptionpublic static void saveJPEG(BufferedImage bi, File f, double qf) throws IOException
IOExceptionpublic static BufferedImage loadGIF(File f, int buffertype) throws IOException
IOExceptionpublic static BufferedImage loadGIF(InputStream is, int buffertype) throws IOException
IOExceptionpublic static BufferedImage loadGIF(InputStream is) throws IOException
IOExceptionpublic static BufferedImage loadGIF(File f) throws IOException
IOExceptionpublic static void saveGIF(BufferedImage bi, OutputStream os) throws Exception
Exceptionpublic static void saveGIF(BufferedImage bi, File f) throws Exception
Exceptionpublic static void savePNG(BufferedImage bi, File f) throws Exception
Exceptionpublic static void savePNG(BufferedImage bi, OutputStream f) throws Exception
Exceptionpublic static BufferedImage loadFile(File f) throws IOException
IOExceptionpublic static Image loadFile_image(File f) throws IOException
IOExceptionpublic static BufferedImage loadStream(InputStream is, String type) throws IOException
IOExceptionpublic static Image awtLoadImage(File f) throws IOException
IOExceptionpublic static BufferedImage awtLoadBufferedImage(File f) throws IOException
IOExceptionpublic static BufferedImage resizeFiltered_RAW(BufferedImage bi, int w, int h, ResamplerFilter fil)
public static BufferedImage resizeFiltered_RAW(BufferedImage i, int w, int h)
public static BufferedImage resizeFiltered(BufferedImage bi, int w, int h, ResamplerFilter fil)
public static BufferedImage resizeFiltered(BufferedImage i, int w, int h)
public static BufferedImage awtResize(BufferedImage bi, int w, int h)
public static double findQualityBySize(BufferedImage bi, int sizenear)
public static void saveImageByMime(OutputStream os, BufferedImage bi, String mime) throws Exception
Exceptionpublic static Dimension getImageDimension(File resourceFile) throws IOException
IOException@Nullable public static Dimension getImageDimension(@Nonnull InputStream is) throws IOException
IOExceptionpublic static void main(String[] args)
Copyright © 2017 etc.to. All rights reserved.