If you take a screen shot (command + shift + 4) or partial screen shot (command + shift + control + 4) you can save it directly to an image file with:
pngpaste filename.png
If you take a screen shot (command + shift + 4) or partial screen shot (command + shift + control + 4) you can save it directly to an image file with:
pngpaste filename.png
To change it: open Screenshot app (either cmd+shift+5 or from the app launcher), click Options in the center bar, and set "Save to" to "clipboard". Now, all screenshots in the future will be going by default to clipboard. You can also pick many other destinations for saving, including any arbitrary directory or many other apps (e.g., mail, preview, etc.).
After some googling TIL, apparently if you use Ctrl key modifier with any screenshot shortcuts (cmd+shift+3/4), it will store to clipboard regardless of your setting. Kinda nifty for those who switch between storing to file/clipboard all the time.