def load_image(canvas, filepath, bounds=None):
image_data = Image.open(filepath)<EOL>if bounds:<EOL><INDENT>image_data.thumbnail(bounds, PIL.Image.ANTIALIAS)<EOL><DEDENT>canvas.image = ImageTk.PhotoImage(image_data)<EOL>canvas.create_image(<NUM_LIT:0>, <NUM_LIT:0>, image=canvas.image, anchor=tk.NW)<EOL>
Takes a tk.Canvas and a filepath, loads image into canvas