Java Utililty Methods Image to BufferedImage

List of utility methods to do Image to BufferedImage

Description

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

Method

BufferedImagetoBufferedImage(Image image)
Convert an Image to a BufferedImage.
if (image instanceof BufferedImage) {
    return (BufferedImage) image;
image = new ImageIcon(image).getImage();
boolean hasAlpha = true; 
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
...
BufferedImagetoBufferedImage(Image image)
to Buffered Image
image = new ImageIcon(image).getImage();
BufferedImage bufferedImage = new BufferedImage(image.getWidth(null), image.getHeight(null),
        BufferedImage.TYPE_INT_RGB);
Graphics g = bufferedImage.createGraphics();
g.setColor(Color.white);
g.fillRect(0, 0, image.getWidth(null), image.getHeight(null));
g.drawImage(image, 0, 0, null);
g.dispose();
...
BufferedImagetoBufferedImage(Image image)
to Buffered Image
BufferedImage bufferedImage;
try {
    image = new ImageIcon(image).getImage();
    bufferedImage = new BufferedImage(image.getWidth(null), image.getHeight(null),
            BufferedImage.TYPE_INT_RGB);
    Graphics2D g = bufferedImage.createGraphics();
    g.setColor(Color.white);
    g.fillRect(0, 0, image.getWidth(null), image.getHeight(null));
...
BufferedImagetoBufferedImage(Image image)
Convert an image into a buffered, compatible image
if (image instanceof BufferedImage) {
    return (BufferedImage) image;
image = new ImageIcon(image).getImage();
boolean hasAlpha = hasAlpha(image);
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
int transparency = Transparency.OPAQUE;
...
BufferedImagetoBufferedImage(Image image)
to Buffered Image
if (image instanceof BufferedImage) {
    return (BufferedImage) image;
image = new ImageIcon(image).getImage();
boolean hasAlpha = hasAlpha(image);
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
...
BufferedImagetoBufferedImage(Image image)
This method returns a buffered image with the contents of an image.
if (image instanceof BufferedImage) {
    return (BufferedImage) image;
image = new ImageIcon(image).getImage();
boolean hasAlpha = hasAlpha(image);
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
...
BufferedImagetoBufferedImage(Image image)
To buffered image.
if (image instanceof BufferedImage) {
    return (BufferedImage) image;
image = new ImageIcon(image).getImage();
boolean hasAlpha = hasAlpha(image);
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
...
BufferedImagetoBufferedImage(Image image)
to Buffered Image
if (image instanceof BufferedImage) {
    return (BufferedImage) image;
image = new ImageIcon(image).getImage();
boolean hasAlpha = hasAlpha(image);
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
...
BufferedImagetoBufferedImage(Image image)
to Buffered Image
if (image instanceof BufferedImage) {
    return (BufferedImage) image;
image = new ImageIcon(image).getImage();
boolean hasAlpha = hasAlpha(image);
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
...
BufferedImagetoBufferedImage(Image image)
to Buffered Image
if (image instanceof BufferedImage) {
    return (BufferedImage) image;
image = new ImageIcon(image).getImage();
boolean hasAlpha = hasAlpha(image);
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
...