Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

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.

Is there a convenient way to save a window without its shadow?

share|improve this question
add comment

4 Answers

up vote 19 down vote accepted

You can disable the shadow added when capturing an entire window by executing the following command from the Terminal:

defaults write com.apple.screencapture disable-shadow -bool TRUE

You'll need to reboot or restart the UIServer for the changes to take effect:

killall SystemUIServer

You can undo this preference and re-enable shadows by executing the following:

defaults write com.apple.screencapture disable-shadow -bool FALSE; killall SystemUIServer
share|improve this answer
add comment

Another option is to use screencapture:

screencapture -oic

-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

You can also use toggle-osx-shadows to disable shadows everywhere in OS X:

git clone https://github.com/pufuwozu/toggle-osx-shadows.git;cd toggle-osx-shadows;make;mv toggle-osx-shadows /usr/local/bin;toggle-osx-shadows

share|improve this answer
2  
also very useful when one wants to capture from a script. –  Calaf May 9 '12 at 17:09
add comment

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.

I'm unsure if this only applies to Mountain Lion and later.

share|improve this answer
1  
Works in Mavericks. That's awesome! –  daGUY Feb 5 at 20:11
    
Works in 10.8.5. Very convenient. –  Sanghyun Park Apr 4 at 7:47
    
Superb - easiest answer by far! –  James Adam Jun 5 at 23:37
add comment

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):

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.