I've got a little app to resize and watermark images. At the moment it only does one at a time but I would like to get it to do a full folder of images in one go. I have done this previously in VB using loops but im new to python and can't seem to get it to work. The running bit of the code I have is below and "watermark" is a function that given the 3 parts overlays and saves the image.
def run(): #define variables and loop here #jpeg load and save a = tkFileDialog.askopenfile() im = Image.open(a) b = tkFileDialog.askopenfile() mark = Image.open(b) c = tkFileDialog.askopenfile() mark2 = Image.open(c) watermark(im, mark, mark2).save('output.jpg', "JPEG", quality=100)
Im guessing at using a tkFileDialog.askdirectory() then setting a loop to run the watermark function on all the images in the directory. I will neew a way to save them all aswell, possibly a counter in the loop to name them output1.jpg output2.jpg ect.
Thanks in advance,