[Python] PIL getcolors returning None for some particular images

Discussão em 'Python' iniciado por Stack, Julho 28, 2025.

  1. Stack

    Stack Membro Participativo

    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:

    [​IMG]

    everything works perfectly, but when I use this:

    [​IMG]

    PIL literally returns None. I am very confused.

    Note: The second image is absolutely massive, unlike the first.

    Continue reading...

Compartilhe esta Página