Clean all the pixels that are outside the canvas size using a script snippet as a part of a sequence for Actuator Krita Plugin.
from krita import Krita
def clean_canvas():
app = Krita.instance()
doc = app.activeDocument()
doc.crop(0, 0, doc.width(), doc.height())
doc.refreshProjection()
clean_canvas()
Download this sequence.