Java Utililty Methods Image

List of utility methods to do Image

Description

The list of methods to do Image are organized into topic(s).

Method

ImagegetChatLogoImageBig(int width, int height)
get Chat Logo Image Big
return getChatLogoImage().getScaledInstance(width, height, Image.SCALE_AREA_AVERAGING);
ImagegetColoredImage(Color color, int width, int height)
Obtiene una imagen coloreada con un color especifico
BufferedImage img = toBufferedImage(getEmptyImage(width, height));
Graphics2D g = img.createGraphics();
g.setColor(color);
g.fillRect(0, 0, width, height);
g.dispose();
return img;
ImagegetDisabledImage(Image image)
Replies the disabled (grayed) version of the specified image.
return Toolkit.getDefaultToolkit()
        .createImage(new FilteredImageSource(image.getSource(), new GrayFilter(true, 20)));
ImageIcongetEingabeImage(int x, int y)
get Eingabe Image
if (Eingabe == null) {
    Eingabe = new ImageIcon(IMAGE_FOLDER + EINGABE_IMAGE);
return prepareImage(Eingabe, x, y);
intgetHeight(Image imagen)
Obtiene el alto de una Image
int height = new ImageIcon(imagen).getIconHeight();
return height;
ImageIcongetImageByFilename(String filename)
get Image By Filename
return new ImageIcon("resources/images/" + filename);
ImagegetImageImmediate(final Image image)
Because of the way image loading works in Java, if one wants to IMMEDIATELY get a fully loaded image, one must resort to "hacks" by loading the image twice.
image.flush();
final Image loadedImage = new ImageIcon(image).getImage();
loadedImage.flush();
return loadedImage;
BufferedImageGetImagenConTamanioDado(File file, int ancho, int alto)
Get Imagen Con Tamanio Dado
BufferedImage bi = null;
if (file.exists()) {
    String nombreFile = file.getName();
    String extension = nombreFile.substring(nombreFile.indexOf("."));
    if ((extension.endsWith("jpg") || extension.endsWith("JPG"))
            || (extension.endsWith("png") || extension.endsWith("PNG"))
            || (extension.endsWith("bmp") || extension.endsWith("BMP"))) {
        Image img = new ImageIcon(file.getAbsolutePath()).getImage();
...
ImagegetImageWithBorder(Image imagen)
Pone borde a una imegen
int w = getWidth(imagen);
int h = getHeight(imagen);
Graphics g = imagen.getGraphics();
g.setColor(Color.WHITE);
int[] xpointsT = { 0, w, w - 1, 1 };
int[] ypointsT = { 0, 0, 1, 1 };
g.fillPolygon(xpointsT, ypointsT, 4);
int[] xpointsL = { 0, 0, 1, 1 };
...
InputStreamgetInputStreamFromImage(Image imagen, String format)
Obtiene un objeto InputStream a partir de un objeto Image
BufferedImage bi = toBufferedImage(imagen);
ByteArrayOutputStream buffer_img = new ByteArrayOutputStream();
try {
    ImageIO.write(bi, format, buffer_img);
} catch (Exception e) {
    throw new RuntimeException(e);
byte[] bytes = buffer_img.toByteArray();
...