Summary
To disable the screenshot shadow, run
defaults write com.apple.screencapture disable-shadow -bool true; killall SystemUIServer
And to enable the screenshot shadow, run
defaults write com.apple.screencapture disable-shadow -bool false; killall SystemUIServer
By default, when you take a cropped screenshot of a window (with command-shift-4
), the screenshot has a shadow:

To disable this shadow, run the following commands in Terminal:
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer
Screenshots should not have the shadow anymore:

To re-enable shadows on screenshots, run the following commands:
defaults write com.apple.screencapture disable-shadow -bool false
killall SystemUIServer