Having written the code to convert one image to a grayscale, we'd like to go one stop further and convert many images to grayscale. We've started here with the class we wrote in the previous video in which we implemented our algorithm in code. I've added a method at the bottom, select and convert, which is going to let us select a bunch of files and convert them all. You've already seen this code before which iterates over a selection of files and just prints out their name. Now we're gonna combine these two ideas to give us code which is going to iterate over a bunch of files and convert them all to gray scale. So we're going to start with a very similar structure here. We're going to make a directory resource. It's going to a new directory resource and we're going to say for file F in directory resource dot and if you don't remember this name you can look at the API, or look at the code we did before. It's going to be selected files. And what we did last time was we just printed out F. What we're going to do this time is we're going to convert the image corresponding to that file to grayscale. So I want an image resource in file which is going to be a new image resource. And I'd like to create this from F, this is, make an image by reading in this file. Then, I would like another ImageResource, which we're going to get by calling makeGray, the method we wrote before. Passing in, I called it inFile, but I really prefer to call it inImage since it's actually an image. And then the last thing we're gonna do, is just draw this file so we can see something happening. So, I'm going to compile this. And it told me it cannot find the symbol class file. What we need to do to use file is import java .io.*, because that's the package in which files are. Now it compiles fine. And now I'm gonna go back over here to my main BlueJ window. I'm going to make a new grayscale converter. And now I'm gonna click on this and I'm gonna choose select and convert. And it popped up this dialogue. And if we navigate through here back to somewhere there are images. We can now pick some selection of pictures that we would like to convert each of them to. And you can see that it went through and converted each of these pictures into grayscale and drew the resulting image. I think it's still converting one of them. The last one was really big. All right? So now, we've put those two ideas together. We've converted any set of images you select. The next step is going to be to save these images to a file.