Oh hey I wrote something similar. https://github.com/fragmede/pasteboard-image
I used python so it's annoying to install, and I need to work on the readme, but I snoop the command line so pbipaste > foo.jpeg works as expected. there's also a copy command
That’s neat! Does it handle pipes as well?
For less annoying installation, perhaps publish it to Homebrew and/or PyPI?