pbcopy/pbpaste are gems that more Mac users need to know about. A command line interface for your clipboard is invaluable and really ties together jumps from UI to CLI.
Regarding the other thoughts in this post, I have to agree. I use iTerm instead of Terminal.app, but if I had even the remotest fear that it was sending anything elsewhere, I would jump ship. My terminal has all kinds of information that can act on my behalf, and I wouldn't want any of it leaving my Mac at all, ever, period. Had this been open-ish source but not phoned home, I'd give it a try. But opaque data leaving for who knows where? Nope.
Looks easy. Yet you need to write the JPG to a temp file first since applescript does not seem to be able to parse JPEG without seek(), hence no piping / streaming possible.
Regarding the other thoughts in this post, I have to agree. I use iTerm instead of Terminal.app, but if I had even the remotest fear that it was sending anything elsewhere, I would jump ship. My terminal has all kinds of information that can act on my behalf, and I wouldn't want any of it leaving my Mac at all, ever, period. Had this been open-ish source but not phoned home, I'd give it a try. But opaque data leaving for who knows where? Nope.