Save screenshots as JPEG on a Mac

A single Terminal command tells macOS to save screenshots as JPEG (or TIFF, GIF, PDF) instead of PNG.