# Create tempfile temp_filename = "c:\\vtscans\\thumbtmp.bmp" pdb.file_bmp_save(image, image.active_drawable, temp_filename, temp_filename) # Get Thumbnail Properties x_scale = 72/xres y_scale = 72/yres new_width = width * x_scale new_height = height * y_scale # Create Thumbnail imfile = temp_filename im = Image.open(imfile) im = im.resize((new_width, new_height), Image.BICUBIC) im.save("c:\\vtscans\\thumb1.jpg") # Remove Temporary Bitmap os.remove(temp_filename)