I am getting weird behaviour when using PIL, here is my code:
main_img = Image.open(image_url)
all_colors = main_img.getcolors(maxcolors=100000)
when I use this image:
everything works perfectly, but when I use this:
PIL literally returns None
. I am very confused.
Note: The second image is absolutely massive, unlike the first.
.getcolors()
returns None
if the number of colors exceeds a limit, but I never expected any images I used to have over 100000 colors.
I changed the value to 100 million so I hopefully never face this problem ever again.
all_colors = main_img.getcolors(maxcolors=100000000)