To stop this happening you need to run a 'scrub' cycle frequently. Each day (well early morning) I run a cron job that sets all the pixels red, then black then white (I have the Pimoroni display) including the display frame / edge.
My code is based around their support library but should give you a basic idea:
class InkyScreen:
def __init__(self, Colour, Rotate = 0, Size = (212, 104)):
if Colour.upper() not in ['RED', 'YELLOW', 'BLACK']:
Colour = 'RED'
if Rotate not in [0, 90, 180, 270]:
Rotate = 0
if Size not in [(212, 104), (104, 212), (400, 300) , (300, 400)]:
Size = (212, 104)
self.colour = Colour
self.border = Colour
self.rotate = Rotate
self.image_obj = Image.new('P', Size)
self.screen_image = ImageDraw.Draw(self.image_obj)
self.width = Size[0]
self.height = Size[1]
self.dev = InkyPHAT(Colour)
def clear(self, Colour = InkyPHAT.WHITE, Border = InkyPHAT.WHITE):
self.screen_image.rectangle([(0 ,0), (self.width, self.height)], \
fill = Colour, \
outline = None )
self.border = Border
def show(self):
self.dev.set_image(self.image_obj.rotate(self.rotate))
self.dev.set_border(self.border)
self.dev.show()
def scrub(self,cycles = 3):
colours = [InkyPHAT.RED, InkyPHAT.BLACK, InkyPHAT.WHITE]
for i in range(cycles):
for index, colour in enumerate(colours):
self.clear(Colour = colour, Border = colour)
self.show()
As your screen has been 'set' for a while, you may want to add a delay of a minute or so between each colour change and run the scrub a few times while checking on it.
The cause is due to the discharge not being complete and leaving some cells 'stuck' in part charged states - hence the ghost image.