Open Source

Learn how to take a screenshot

If you want to capture what's on your computer screen and put it in an image file, try to take the screenshot on a computer with a high-color or true-color display. Here's how.

By Paul Anderson

There will be occasions when you want to capture what's on your computer screen and put it in an image file. Unless the entire screen contains only a very few colors, try to take the screenshot on a computer with a high-color or true-color display. This is especially applicable when you're capturing a Web browser, as browsers frequently dither or substitute colors when running on an 8-bit display. If you have no choice but to grab a screen in 256 colors, at least turn off dithering.

In Windows, you have two options. Press the Print Screen (or PrtScn) key on your keyboard to copy the entire screen to the clipboard. Press Alt-Print Screen to copy only the active window. Next you'll need to open an image editor (Microsoft Paint, which comes with Windows, is fine if you don't plan on doing any fancy editing), create a new file, and select Paste from the Edit menu.

You have more choices on a Macintosh. Pressing Command-Shift-3 creates a PICT file of the entire screen in the top directory of your boot drive. Press Command-Shift-4 to change the cursor to a cross, which you can click and drag to select an area of the screen to capture in a PICT file. The same combination with Caps Lock activated changes the cursor to a circle; click a window with the circle to create a PICT of that window. Adding the Control key to any of these combinations copies the screen image to the clipboard.

For X Window desktops such as GNOME and KDE, the command xwd -out filename.xwd lets you click a window to make an XWD image of it. Adding the -frame option will capture the entire window manager. The popular utility xv also does screen captures, and KDE comes with the utility ksnapshot.

Finally, if you plan to edit the screenshot before using it on your Web site or elsewhere, be sure to save it in a true image format. Don't make the screenshot endure GIF reduction or JPEG encoding twice.

Paul Anderson is associate technical editor for CNET Builder.com. His responsibilities don't include handling graphics, so naturally, he handles them all the time.

Editor's Picks

Free Newsletters, In your Inbox