PiSupply/PaPiRus

Preview Mode?

Opened this issue · 1 comments

I would like to be able to preview a change as an image (png, jpg, whatever) before writing it directly to the device. I've looked through the code and don't see any way to do this. Could we create either a flag for the CLIs or maybe a mode for the objects where instead of writing changes to the device the tools instead write a file to some path? I figure the EPD.display method might be a good option for this capability?

I put this block in the display method, for anyone interested in experimenting with this kind of functionality:

        test_path = os.environ.get('TEST_IMAGE', '')
        if test_path != '':
            image.save(test_path, 'PNG')
            return

This command produced the following image:

TEST_IMAGE=x.png papirus-write test2

x