Java BufferedImage Color Set changeToTypeIntRGB(BufferedImage image)

Here you can find the source of changeToTypeIntRGB(BufferedImage image)

Description

change To Type Int RGB

License

Apache License

Declaration

public static BufferedImage changeToTypeIntRGB(BufferedImage image) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage changeToTypeIntRGB(BufferedImage image) {

        // Creates a new buffered image of type int rgb (the one we need for everything to work
        BufferedImage output = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);

        // Loops through all of original image and gives output the image properties (except for the new type output has)
        for (int y = 0; y < image.getHeight(); y++)
            for (int x = 0; x < image.getWidth(); x++)
                output.setRGB(x, y, image.getRGB(x, y));

        return output;
    }//from  w  w  w .  j a v  a2s.  c  o  m
}

Related

  1. changeBrightness(BufferedImage image, int offset)
  2. changeColor(BufferedImage image, Color color, Color replacement_color)
  3. changeColor(BufferedImage image, Color replacement)
  4. changeColor(BufferedImage image, String hexval)
  5. changeRGBSaturation(final BufferedImage image, final double s)
  6. changeTranslucentImage(BufferedImage img, float transperancy)