If I take a screenshot with Shift ⇧ + Command ⌘ + 4 + Space, then I get one of the two images:

Either way the saved image is surrounded by the shadow halo. I could then edit it out by hand (using Preview) to discard the shadow, or I could use Shift ⇧ + Command ⌘ + 4 and try to pinpoint the boundary by hand, but neither lets me get a pixel-perfect boundary easily.

Quick solution as posted by @asherkinbelow: Hold the Option key while clicking (after doing the Cmd-Shift-4, Space dance) and the saved screenshot will not have the drop shadow !
–
iolsmitAug 25 '14 at 16:26

Technically, a fresh install of OSX doesn't have that default at all. Running defaults read com.apple.screencapture disable-shadow gives you The domain/default pair of (com.apple.screencapture, disable-shadow) does not exist. Therefore the more accurate way to undo the change is with defaults delete com.apple.screencapture disable-shadow.
–
Bruno BronoskyFeb 5 at 6:20

-o disables shadows, -i captures an area, and -c copies the image to the clipboard.

This would use a timer of 5 seconds and save the image to a file:

screencapture -oi -T5 /tmp/screencapture.png

Run screencapture -h to list all options:

$ screencapture -h
screencapture: illegal option -- h
usage: screencapture [-icMPmwsWxSCUtoa] [files]
-c force screen capture to go to the clipboard
-C capture the cursor as well as the screen. only in non-interactive modes
-d display errors to the user graphically
-i capture screen interactively, by selection or window
control key - causes screen shot to go to clipboard
space key - toggle between mouse selection and
window selection modes
escape key - cancels interactive screen shot
-m only capture the main monitor, undefined if -i is set
-M screen capture output will go to a new Mail message
-o in window capture mode, do not capture the shadow of the window
-P screen capture output will open in Preview
-s only allow mouse selection mode
-S in window capture mode, capture the screen not the window
-t<format> image format to create, default is png (other options include pdf, jpg, tiff and other formats)
-T<seconds> Take the picture after a delay of <seconds>, default is 5
-w only allow window selection mode
-W start interaction in window selection mode
-x do not play sounds
-a do not include windows attached to selected windows
-r do not add dpi meta data to image
-l<windowid> capture this windowsid
-R<x,y,w,h> capture screen rect
files where to save the screen capture, 1 file per screen

Another useful option is to use TinkerTool. Go to TinkerTool and under the General tab, you'll find an option to disable shadows only when taking screenshots (along with several other related options):

I know this is an old question - but I can never find this information when searching for it (just the information in the accepted answer to turn it off globally), and end up just trying random keys each time.

If you hold Option while clicking (after doing the Cmd-Shift-4, Space dance), the saved screenshot will not have the drop shadow.