In the Terminal, and prior to Mojave, you would enter the following to change the default image format with the screencapture shortcuts. By default, Mojave does not include the key 'type' in its screencapture plist, and one must add it with the appropriate image capture format.
Prior to Mojave (as tested on High Sierra) — because I had set it to png:
defaults read com.apple.screencapture
{
"disable-shadow" = 1;
type = png;
}
defaults write com.apple.screencapture type -string jpg
defaults read com.apple.screencapture
{
"disable-shadow" = 1;
type = jpg;
}
Now your screen capture shortcuts will output JPG images.
Mojave and later
Make a backup copy of the screencapture plist file, and then add the new key type with its string value jpg.
cp ~/Library/Preferences/com.apple.screencapture.plist ~/Library/Preferences/com.apple.screencapture.plist.bak
defaults write com.apple.screencapture type -string jpg
defaults read com.apple.screencapture
{
"last-messagetrace-stamp" = "568258083.601015";
"last-selection" = {
Height = 231;
Width = 380;
X = 286;
Y = "369.5";
};
"last-selection-display" = 0;
"location-last" = "/Applications";
style = selection;
target = file;
type = jpg;
video = 0;
}
Now, on Mojave, all screen capture shortcuts (including the new ⇧⌘5) will default to JPG image captures.
If you want to change the JPG back to PNG again:
defaults write com.apple.screencapture type -string png