public ImageRGB(BufferedImage bi) { 
         width = bi.getWidth(); 
         height = bi.getHeight(); 
         pixels = new int[width * height]; 
         int[] tmp=bi.getRGB(0,0,width,height,pixels,0,width); 
    }