public BufferedImage settnewrgb(BufferedImage gambarbaru, int[][] red, int[][] green, int[][] blue) {

         int patokan = gambarbaru.getWidth() / 2;

         WritableRaster raster = gambarbaru.getRaster();
      
        for (int i = 0,d=patokan; i < 72; i++,d++) {
            for (int j = 0,e=patokan; j < 72; j++,e++) {
               

                int R = red[i][j];
                int G = green[i][j];
                int B = blue[i][j];
                //System.out.println(B);
                int gray = R << 16 | G << 8 | B;
                gambarbaru.setRGB(d, e, gray);
               
            }
        }
        return gambarbaru;
    }