Here you can find the source of conformImageToInt(BufferedImage in)
public static BufferedImage conformImageToInt(BufferedImage in)
//package com.java2s; //License from project: LGPL import java.awt.*; import java.awt.image.*; public class Main { public static boolean warn = true; public static BufferedImage conformImageToInt(BufferedImage in) { return convertImage(in, BufferedImage.TYPE_INT_RGB); }/*from w w w . jav a 2 s . co m*/ /** * Ensure an image is of the right format, converting it to the * format if necessary. * @param in The input image, in any format. * @param type The desired type, e.g. BufferedImage.TYPE_3BYTE_BGR * @return An image with analagous content as in, but of the * requested type. Or, if the input image was already in the * requested format, the input image is returned. **/ public static BufferedImage convertImage(BufferedImage in, int type) { if (in.getType() == type) return in; if (warn) { System.out.println("ImageUtil: Performing slow image type conversion"); warn = false; } int w = in.getWidth(); int h = in.getHeight(); BufferedImage out = new BufferedImage(w, h, type); Graphics g = out.getGraphics(); g.drawImage(in, 0, 0, null); g.dispose(); return out; } }