By default bokeh plots offer a direct png export without any additional dependencies.
However for the export_png or get_screenshot_as_png function a selenium + ChromeDriver dependency is required.
I am wondering if that can be avoided because the JS code for the direct png export is basically already available. In other words I’d like to use the get_screenshot_as_png functionality without the additional depencencies.
The “on-plot” save tool has immediate access to the HTML canvas and can just save the data out from JavaScript. Anything from Python will have to drive a browser to first generate a plot to save, full stop. In the future, it may be possible to avoid Selenium, e.g. by using the Chrome dev APIs directly, but a browser of some kind will always be a requirement. If you need to generate images without a browser, then you should probably look to other tools.
I probably wasn’t really precise what I actually need. The browser is still available in my case and I’d like to transfer the png image back to Python from the JS part for further processing (embedding png images into pdf/powerpoints, etc.).