def write_img(self, img, filename=None):
        if filename is None:
            suffix = 0;
            filepat = "screen%d.png"
            while os.path.exists(filepat % suffix):
                suffix = suffix + 1
            filename = filepat % suffix
        io.write_png(filename, img)
        print("Wrote " + filename)
dataset/ETHPy150Open alexjc/shadertoy-render/shadertoy-render.py/RenderingCanvas.write_img/original