Ciao a tutti ho bisogno di una funz che fondi insieme piu immagini!!!!!

Diciamo che splitto il file jpg con questa funzione:

public static BufferedImage[] splitImage(BufferedImage img, int cols, int rows)
{
int w = img.getWidth()/cols;
int h = img.getHeight()/rows;
int num = 0;
BufferedImage imgs[] = new BufferedImage[cols*rows];

for(int y = 0; y < rows; y++)
{
for(int x = 0; x < cols; x++)
{
imgs[num] = new BufferedImage(w, h, img.getType());
// Tell the graphics to draw only one block of the image
Graphics2D g = imgs[num].createGraphics();
g.drawImage(img, 0, 0, w, h, w*x, h*y, w*x+w, h*y+h, null);
g.dispose();
num++;
} //fine for interno
} //fine for esterno
return imgs;
}//fine funz split

Questa è la funzione che esegue il merge(suppongo di dividere l'immagine in nove pezzettini ...quindi gli passo width=3 height = 3):
public static BufferedImage mergeImage(BufferedImage[] imgFrame, int width, int height)
{
int size = imgFrame.length;

//suppongo frame colonne == righe
int rows =(int) Math.sqrt(size);
int cols = rows;

BufferedImage Im = new BufferedImage(width, height, imgFrame[0].getType());

int i=0;
for( int Irows=0; Irows< rows; Irows++)
{
for(int Icols=0; Icols< cols; Icols++)
{
// chiedo a Graphics di disegnare su Im width x height
Graphics2D g = Im.createGraphics();
g.drawImage(Im, 0, 0, imgFrame.getWidth(), imgFrame.getHeight(), imgFrame.getWidth()*Irows, imgFrame.getHeight()*Icols, imgFrame.getWidth()*Irows+imgFrame.getWidth(), imgFrame.getHeight()*Icols+imgFrame.getHeight(), null);
g.dispose();

i++;
}//fine for interno
}//fine for esterno


return Im;
} //fine merge


Sia Split che Merge funzionano solo che c'è un piccolo problema se a Merge passo il BufferedImage[] ritornato da split mi crea l'immagine tranquillamente...
Ho bisogno di una funzione che mi faccia riottenere da dei file in jpeg salvati su disco un vettore di BufferedImage[] da passare a merge.....finora ho provicchiato ma mi esce una bella immagine NERA CHE PIU NERA NON SI PUO!!
Qualcuno conosce qualche metodo o classe che danno la possibilità di fare queste operazioni sui jpeg?????


thx in Anticipo per la risposta