Is it possible to save a figure as an image?

I was wandering if there’s any way (or a workaround) to save a figure to an image without having to use a browser.
Something that will look like:

from bokeh.plotting import figure

f = figure()[1, 2, 3], y=[2, 4, 6])


All Bokeh rendering is actually done by BokehJS. There is no non-JavaScript rendering backend. You can generate png or svg output with export_png and export_svg but these will drive a browser headlessly behind the scenes. It’s not clear whether your concern is avoiding only explicit user interaction with a browser, or with avoiding any browser usage anywhere, even hidden in the background.

Thanks! I would like to create the image without the need of a browser at all so it won’t be needed as a dependency.