def transparent_pix(self): op = self.ctx.get_operator() self.ctx.set_operator(OPERATOR_SOURCE) self.ctx.set_source_rgba(*[1, 1, 1, 0.95]) self.dot(1-self.pix, 1.0-self.pix) self.ctx.set_operator(op)