Skip to content

IndexError: image index out of range #5

@LordOfTheSnow

Description

@LordOfTheSnow

Could you please provide a little more info how to use your example program?

After a lot of hassling around with the bluetooth connection (finally had to run your program with sudo privileges) I get this error message:

IndexError: image index out of range

This is the callstack:

sudo python3 pixoo.py 11:75:58:BB:BF:71 cropped-icon-16x16.png
Traceback (most recent call last):
  File "pixoo.py", line 320, in <module>
    pixoo.draw_pic(img_path)
  File "pixoo.py", line 231, in draw_pic
    nb_colors, palette, pixel_data = self.encode_image(filepath)
  File "pixoo.py", line 247, in encode_image
    return self.encode_raw_image(img)
  File "pixoo.py", line 265, in encode_raw_image
    pix = img.getpixel((x,y))
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 1315, in getpixel
    return self.im.getpixel(xy)
IndexError: image index out of range

This is the image that I tried:

cropped-icon-16x16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions