Take screenshots as JPG on macOS
By Flavio Copes
Learn how to make macOS save screenshots as JPG instead of PNG with the defaults write com.apple.screencapture type jpg command to shrink huge files.
To make macOS save screenshots as JPG instead of PNG, run two commands in the terminal:
defaults write com.apple.screencapture type jpg
followed by
killall SystemUIServer
From now on, every screenshot you take is saved as a JPG file.
Here’s why I did this. I take tons of screenshots on my Mac using the key combination cmd-shift-4, and after I switched from my old Apple Cinema Display which wasn’t retina to the new Studio Display which is 5K, I noticed the size of some screenshots was HUGE.
macOS by default uses PNG as the format for screenshots, and depending on what’s in the screenshot, you can have like 10MB screenshots very easily.
JPG uses lossy compression, so the same screenshot often drops to a fraction of the size.
What do these commands do?
defaults write changes a setting in the macOS preferences system. com.apple.screencapture is the domain that holds the screenshot settings, and type is the key that decides the file format.
killall SystemUIServer restarts the system process that reads that setting. Without it, the change might not apply until you log out and back in.
Only new screenshots are affected. Existing files stay as they are.
Other formats
JPG is not the only option. You can use png, pdf, or tiff as the value too:
defaults write com.apple.screencapture type pdf
To check what’s currently set:
defaults read com.apple.screencapture type
# jpg
If you never changed the setting, this command errors with “The domain/default pair does not exist”. That means you’re on the PNG default.
How to go back to PNG
Delete the key and restart the process again:
defaults delete com.apple.screencapture type
killall SystemUIServer
macOS falls back to the default, which is PNG.
The tradeoff
JPG is lossy. Screenshots of text or sharp UI edges can show slight compression artifacts if you zoom in.
JPG also has no transparency. When you capture a window with cmd-shift-4 then space, the drop shadow around the window normally sits on a transparent background. As JPG, it gets flattened onto a solid one.
For most screenshots this doesn’t matter, and the smaller files are worth it. If you need pixel-perfect captures for design work, switch back to PNG for those.
Related posts about mac: