PiSupply / PaPiRus

Resources for PaPiRus ePaper eInk displays
https://www.pi-supply.com/product/papirus-epaper-eink-screen-hat-for-raspberry-pi/
Other
345 stars 88 forks source link

Preview Mode? #228

Open frioux opened 1 year ago

frioux commented 1 year ago

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?

frioux commented 1 year ago

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