Inky 7color - doing set_pixel after set_image may be causing an error

Hello, I do the following in Python:

#!/usr/bin/env python3

import sys
import random
import time

from PIL import Image, ImageFont, ImageDraw
from inky.inky_uc8159 import Inky

inky = Inky()
saturation = 0.5

aImageList = [1,2,3]
aColorsList = [3,4,5]

while True:

    print("cjf doing clear")
    for y in range(inky.height):
        color = random.choice(aColorsList)
        for x in range(inky.width):
            inky.set_pixel(x, y, color)

    iUseImage = random.choice(aImageList)
    sImagePath = "images/project/" + str(iUseImage) + ".png"
    print("cjf using image: " + sImagePath)
    image =
    inky.set_image(image, saturation=saturation)

Works great first pass.

On the second time around the loop, this error:

Traceback (most recent call last):
  File "", line 25, in <module>
    inky.set_pixel(x, y, color)
  File "/usr/local/lib/python3.7/dist-packages/inky/", line 342, in set_pixel
    self.buf[y][x] = v & 0x07
IndexError: index 448 is out of bounds for axis 0 with size 448

I have no idea why this simple script would be giving an error. Is there some syntax error I’m not aware of. Otherwise is there an issue doing set_pixel after set_image?