def create_new_image(self): path = ui.Path.rect(*self.bounds) with ui.ImageContext(self.width, self.height) as ctx: ui.set_color((0, 0, 0, 0)) path.fill() return ctx.get_image()