Java - Convert File[] item to BufferedImage
I have an array of 300 image filenames and wish to convert each filename into a new BufferedImage.

Array of 300 image names is created thus:

    //Default image directory (to convert to greyscale).
    static File dir = new File("images");
    //Array of original image filenames.
    static File imgList[] = dir.listFiles();

    public static void processGreyscale(){
        if(dir.isDirectory()){
            for(File img : imgList){
                if(img.isFile()){
                    //functions are carried out here.
                }
                else{
                    //functions are carried out here.
                }
            }
        }
    }

I would now like to convert all `imgList[x]` items to `BufferedImage` items using something along the lines of:

    File file = new File(new BufferedImage(imgList[0-300]));
		
    try {
        image = ImageIO.read(file);
    } catch (IOException e) {
        ...
    }
Java - Convert File[] item to BufferedImage
===

I have an array of 300 image filenames and wish to convert each filename into a new BufferedImage.

Array of 300 image names is created thus:

    //Default image directory (to convert to greyscale).
    static File dir = new File("images");
    //Array of original image filenames.
    static File imgList[] = dir.listFiles();

    public static void processGreyscale(){
        if(dir.isDirectory()){
            for(File img : imgList){
                if(img.isFile()){
                    //functions are carried out here.
                }
                else{
                    //functions are carried out here.
                }
            }
        }
    }

I would now like to convert all `imgList[x]` items to `BufferedImage` items using something along the lines of:

    File file = new File(new BufferedImage(imgList[0-300]));
		
    try {
        image = ImageIO.read(file);
    } catch (IOException e) {
        ...
    }