I have a graphic on the clipboard on OS X.
What's the quickest way to get it onto disk as a png or jpg?
File | New From Clipboard menu of
Here is a utility to do just that.
Paste PNG into files, much like pbpaste does for text.
However instead of
pngpaste > thefile.png, it's
pngpaste thefile.png, so one does not accidentally barf binary into the console.
If you have Preview.app open you can simply 'create new' cmd+n and that will generate the proper canvas and paste the clipboard image. Only thing left to do is save that file. Presto!
Not nearly as slick, but without using Preview.
Finder -> Edit -> Show Clipboard
Cmd+Shift+4 to get the screen shot marquee tool, and copy the part of the clipboard you want. It's now a PNG on your desktop. But probably not precisely the same image file.
But at that rate, you probably could have screen-captured the original source using the same method and went right to the PNG without using the clipboard.
I like to use the command line:
pbpaste > myfile.png
The pbcopy command is useful as well. See this post for details.
Using Preview.app is a way, but a little cumbersome. It can also be done on the command line.
pbpaste can only
pbpaste > filename text snippets, you want to use
Install it with Brew:
brew install pngpaste
and use it: