By default, when taking a screen capture of an entire window on OS X, a shadow will be added to the backdrop of the window.

OS X screen capture window with shadow

This behavior can be disabled by running the following commands in terminal:

defaults write disable-shadow -bool TRUE;  
killall SystemUIServer;  

The first command changes the preference for shadows in screen captures.
The second kills SystemUIServer, which will make the changes take immediate effect.

OS X screen capture window without shadow

If you want to revert the setting and add shadows to screenshots again, run the following command:

defaults write disable-shadow -bool FALSE;  
killall SystemUIServer;