A convenience package for creating images of the current source buffer using Silicon https://github.com/Aloxaf/silicon. It requires you to have the silicon command-line tool installed and preferably on your path. You can specify the path to the executable by setting silicon-executable-path.
The package declares silicon-buffer-file-to-png which tries to create a PNG of the current source code buffer. See the function doc string for more details.
First clone this repository.
Add this to your config:
(add-to-list 'load-path "<PATH TO DIRECTORY>")
(require 'silicon) (use-package silicon
:load-path "<PATH TO DIRECTORY>")