Like {@link #getImage(String)} but the specified colorizations are applied to the image
before it is returned.
195707
public BufferedImage getImage (String path, Colorization[] zations)
    {
        return getImage(null, path, zations);
    }
974043
protected static BufferedImage toBufferedImage(Image image) {
        if (image instanceof BufferedImage) {
            return (BufferedImage) image;
        }

        // This code ensures that all the pixels in the image are loaded
        image = new ImageIcon(image).getImage();

        // Determine if the image has transparent pixels; for this method's
        // implementation, see e661 Determining If an Image Has Transparent
        // Pixels
        boolean hasAlpha = hasAlpha(image);

        // Create a buffered image with a format that's compatible with the
        // screen
        BufferedImage       bimage = null;
        GraphicsEnvironment ge     = GraphicsEnvironment.getLocalGraphicsEnvironment();

        try {

            // Determine the type of transparency of the new buffered image
            int transparency = Transparency.OPAQUE;

            if (hasAlpha) {
                transparency = Transparency.BITMASK;
            }

            // Create the buffered image
            GraphicsDevice        gs = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gs.getDefaultConfiguration();

            bimage = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null), transparency);
        } catch (HeadlessException e) {
            // The system does not have a screen
        }

        if (bimage == null) {

            // Create a buffered image using the default color model
            int type = BufferedImage.TYPE_INT_RGB;

            if (hasAlpha) {
                type = BufferedImage.TYPE_INT_ARGB;
            }

            bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
        }

        // Copy image to buffered image
        Graphics g = bimage.createGraphics();

        // Paint the image onto the buffered image
        g.drawImage(image, 0, 0, null);
        g.dispose();

        return bimage;
    }
460613
public static Graphics getGraphicsForImage(Image image) throws SlickException {
		Graphics g = (Graphics) graphics.get(image.getTexture());
		
		if (g == null) {
			g = createGraphics(image);
			graphics.put(image.getTexture(), g);
		}
		
		return g;
	}
1077402
public static Image getInstance(Image image) {
		if (image == null)
			return null;
		try {
			Class cs = image.getClass();
			Constructor constructor = cs
					.getDeclaredConstructor(new Class[] { Image.class });
			return (Image) constructor.newInstance(new Object[] { image });
		} catch (Exception e) {
			throw new ExceptionConverter(e);
		}
	}
1049532
public static Image getScaledInstance(Image img, int targetWidth, int targetHeight) {
		final int type = BufferedImage.TYPE_INT_ARGB;
		Image ret = img;
		final int width = ret.getWidth(null);
		final int height = ret.getHeight(null);
		if (width != targetWidth && height != targetHeight) {
			// a priori plus performant que Image.getScaledInstance
			final BufferedImage scratchImage = new BufferedImage(targetWidth, targetHeight, type);
			final Graphics2D g2 = scratchImage.createGraphics();
			g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
					RenderingHints.VALUE_INTERPOLATION_BILINEAR);
			g2.drawImage(ret, 0, 0, targetWidth, targetHeight, 0, 0, width, height, null);
			g2.dispose();
			ret = scratchImage;
		}
		return ret;
	}
323997
private static int getTrimmedXStart(BufferedImage img) {
    int height = img.getHeight();
    int width = img.getWidth();
    int xStart = width;

    for (int i = 0; i < height; i++) {
      for (int j = 0; j < width; j++) {
        if (img.getRGB(j, i) != Color.WHITE.getRGB() && j < xStart) {
          xStart = j;
          break;
        }
      }
    }

    return xStart;
  }
159285
@Nullable public de.uniulm.omi.cloudiator.flexiant.client.domain.Image getImage(
        final String imageUUID) throws FlexiantException {
        final io.github.cloudiator.flexiant.extility.Image image =
            this.getResource(imageUUID, ResourceType.IMAGE,
                io.github.cloudiator.flexiant.extility.Image.class);
        if (image == null) {
            return null;
        }
        return new de.uniulm.omi.cloudiator.flexiant.client.domain.Image(image);
    }
886913
private ImageFormat getFormat(List<ImageFormat> l, String n){
		for(ImageFormat f:l)
			if(f.getName().equals(n))
				return f;
		return null;
	}
32541
public com.google.api.ads.adwords.axis.v201809.cm.Image getImage() {
        return image;
    }
362097
public static BufferedImage getSubimage( BufferedImage image, int x, int y, int w, int h ) {
		BufferedImage newImage = new BufferedImage( w, h, BufferedImage.TYPE_INT_ARGB );
		Graphics2D g = newImage.createGraphics();
		g.drawRenderedImage( image, AffineTransform.getTranslateInstance(-x, -y) );
		g.dispose();
		return newImage;
	}
849934
private BufferedImage getImage(int layer) {
		BufferedImage image = layeredImage[layer];
		if (image == null) {
			createImageAndGraphics(layer);
			image = layeredImage[layer];
		}
		return image;
	}
293712
public Img gray() {
		final ColorConvertOp op = new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
		this.targetImage = op.filter(getValidSrcImg(), null);
		return this;
	}
517363
public Colorization getColorization (String className, String colorName)
    {
        ClassRecord crec = getClassRecord(className);
        if (crec != null) {
            int colorId = 0;
            try {
                colorId = crec.getColorId(colorName);
            } catch (ParseException pe) {
                log.info("Error getting colorization by name", "error", pe);
                return null;
            }

            ColorRecord color = crec.colors.get(colorId);
            if (color != null) {
                return color.getColorization();
            }
        }
        return null;
    }
1357249
def get(img, light=False):
    """"""
    colors = gen_colors(img)
    return adjust(colors, light)
942142
public static ByteBuffer getImageByteBuffer(RenderedImage image) {
        ColorModel cm = image.getColorModel();
        WritableRaster wr = image.getData().createCompatibleWritableRaster(image.getWidth(), image.getHeight());
        image.copyData(wr);
        BufferedImage bi = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), null);
        return convertImageData(bi);
    }
15971
public ImageHeuristics getImageSizes(String imgFileName) throws
      IOException
  {
    int pos = imgFileName.lastIndexOf(".");
    if (pos == -1)
    {
      throw new IOException("No extension for file: " + imgFileName);
    }

    String suffix = imgFileName.substring(pos + 1);
    File tempFile = null;
    if ("svg".compareToIgnoreCase(suffix) == 0)
    {
      tempFile = getImageFile(ocf, imgFileName);
      if (tempFile != null)
      {
          long tempFileLength = tempFile.length();
          if (ocf.getClass() == OCFZipPackage.class)
          {
              tempFile.delete();
          }
        return new ImageHeuristics(0, 0, tempFileLength);
      }
      return null;
    }
    
    // Determine format by file extension and by inspecting the file
    tempFile = getImageFile(ocf, imgFileName);
    String formatFromInputStream = null;
    String formatFromSuffix = null;
    ImageInputStream imageInputStream = ImageIO.createImageInputStream(tempFile);
    Iterator<ImageReader> imageReaderIteratorFromInputStream = ImageIO.getImageReaders(imageInputStream);
    while (imageReaderIteratorFromInputStream.hasNext()) {
      ImageReader imageReaderFromInputStream = imageReaderIteratorFromInputStream.next();
      formatFromInputStream = imageReaderFromInputStream.getFormatName();
        
      Iterator<ImageReader> imageReaderIteratorFromSuffix = ImageIO.getImageReadersBySuffix(suffix);
        while (imageReaderIteratorFromSuffix.hasNext()) {
          ImageReader reader = imageReaderIteratorFromSuffix.next();
          formatFromSuffix = reader.getFormatName();
          
          if (formatFromSuffix != null && formatFromSuffix.equals(formatFromInputStream)) break;
        }
        if (formatFromSuffix != null && formatFromSuffix.equals(formatFromInputStream)) break;
    }
    imageInputStream.close();



      if (formatFromSuffix != null && formatFromSuffix.equals(formatFromInputStream)) {
      // file format and file extension matches; read image file
      
      try {
        BufferedImage image = ImageIO.read(tempFile);
        if (image == null) {
          report.message(MessageId.PKG_021, EPUBLocation.create(imgFileName));
          return null;
          
        } else {
          int width          = image.getWidth();
          int height         = image.getHeight();
          return new ImageHeuristics(width, height, tempFile.length());
        }
      }
      catch (IOException e)
      {
        report.message(MessageId.PKG_021, EPUBLocation.create(imgFileName));
        return null;
      }
      catch (RuntimeException argex)
      {
        report.message(MessageId.PKG_021, EPUBLocation.create(imgFileName));
        return null;
      }
      finally
      {
          if (ocf.getClass() == OCFZipPackage.class)
          {
              tempFile.delete();
          }
      }
  
    } else
      {
          if (ocf.getClass() == OCFZipPackage.class)
          {
              tempFile.delete();
          }
          if (formatFromSuffix != null) {
              // file format and file extension differs

              report.message(MessageId.PKG_022, EPUBLocation.create(imgFileName), formatFromInputStream, suffix);
              return null;

          } else {
              // file format could not be determined

              throw new IOException("Not a known image file: " + imgFileName);
          }
      }
  }
537933
function ColorImage(color) {
  this.color = color;
  this.canvas = new Canvas(1, 1);
  this.ctx = this.canvas.getContext('2d');
  this.ctx.fillStyle = color.toString();
  this.ctx.fillRect(0, 0, 1, 1);
}