R, G, B = pixelRGB
brightness = sum([R, G, B]) / 3
imagePaths = sorted(list(paths.list_images(args["images"])))
images = []
for imagePath in imagePaths:
image = Image.open(imagePath)
images.append(image)
# Get image size
image_height = 512
image_weight = 512
# Create an empty white image:
new_im = Image.new('RGB', (9 * image_weight, 9 * image_height))
# Paste new images
for i in range(81):
new_im.paste(images[i], (int(i // 9) * image_weight, int(i % 9) * image_height))
imagePaths = sorted(list(paths.list_images(args["images"])))
images = []