The input is placed in the pasteboard as ASCII data unless it begins with the Encapsulated PostScript (EPS) file header or the Rich Text Format (RTF) file header, in which case it is placed in the pasteboard as one of those data types.
It doesn't sound like image data is supported, so it won't work.
And also paste the image into a document, with the usual ⌘-V.
Original Answer
You can do this without needing to compile any additional software and just use the tools provided in OS X. Basically, the clipboard is unable to store binary, so you need to uuencode your binary image into simple ASCII data like this:
# Copy image to clipboard
uuencode SomeFile.jpg - | pbcopy
and uudecode when going back the other way
# Paste from clipboard to image file
pbpaste | uudecode -o AnotherFile.jpg
From the documentation:
It doesn't sound like image data is supported, so it won't work.
Updated Answer
You can actually put a JPEG image in the clipboard using Applescript like this at the command-line:
You can then check what is on the clipboard with:
And also paste the image into a document, with the usual ⌘-V.
Original Answer
You can do this without needing to compile any additional software and just use the tools provided in OS X. Basically, the clipboard is unable to store binary, so you need to
uuencode
your binary image into simple ASCII data like this:and
uudecode
when going back the other wayAs stated, this won't work with
pbcopy
, but you can write a little objective-c program to do this: http://www.alecjacobson.com/weblog/?p=3816 . Then you can issue: