What is your OS?
I'm not familiar with sublime-text, but I know how to accomplish this goal in BASH.
sudo apt-get install xclip ImageMagick
This is the most simple form of how to output to image:
xclip -selection clipboard -t image/png -o | convert - output.png