Added a function to generate Graphics objects using a directory.