Taking screenshots on Windows used to a laborious process, consisting of performing a print screen then editing the result in Photoshop. Leopard (and indeed, earlier editions of OS X) goes a long way to simplifying the process with different key combinations to achieve different results. It is possible to grab the whole screen, a single window, or a user defined area of the screen. However, I commonly find myself needing to take a screenshot of an entire webpage — not just the portion that is viewable in my browser window.
This is where WebKit2PNG and Paparazzi come in. The former is a command line utility for OS X which uses the WebKit engine (the software powering Safari) to generate full page screenshots. The latter is a piece of software which offers a user friendly interface to the command line utility, making it much easier to use. I’ll focus on the features of Paparazzi first before going a little technical to explain some of the extra features offered by WebKit2PNG.
Using Paparazzi is simple. Open up the application and enter your URL. You can choose the size of the window that you’re emulating and also choose to crop the resulting image. It takes a few seconds to download the screenshot, then there are several export options to different image formats.
The advantage of using this method over the in-built screenshot tool is that it takes the full length image of an entire webpage. The various export options also let you immediately compress the image, rather than being required to import into Photoshop to make changes.
If you would like a higher degree of customization in your screenshot, or need to automate the process, you’ll need to delve a little deeper into WebKit2PNG. This is a command line tool which allows you to either take a standard cropped screenshot, or the longer variety as produced by Paparazzi.
One of the requirements to run the tool is PyObjC 1.1. This is bundled by default with Leopard, but if you’re missing it for any reason it will need installing before you proceed. It simply provides a method for executing the Python code which WebKit2PNG is built upon.
The process of taking a screenshot can be as simple as typing:
python webkit2png-0.4.sh http://theappleblog.com
This would produce three images in the current directory. One is a cropped 200x150px thumbnail, another is a full length thumbnail at 240px wide, and the final one consists of the full width, full length screenshot. The great thing about this tool is the level of customization available, some of which options are as follows:
-W WIDTH, –width=WIDTH : initial (and minimum) width of browser (default: 800)
-H HEIGHT, –height=HEIGHT : initial (and minimum) height of browser (default: 600)
–clipwidth=WIDTH : width of clipped thumbnail (default: 200)
–clipheight=HEIGHT : height of clipped thumbnail (default: 150)
-s SCALE, –scale=SCALE : scale factor for thumbnails (default: 0.25)
-o NAME, –filename=NAME : save images as NAME.png,NAME-thumb.png etc
-F, –fullsize : only create fullsize screenshot
-T, –thumb : only create thumbnail sreenshot
-C, –clipped : only create clipped thumbnail screenshot
-d, –datestamp : include date in filename
-D DIR, –dir=DIR : directory to place images into
The variety of options available allow you to essentially create any size and layout of screenshot you require. The script could even be built into an Automator workflow to process a batch of files at once, or upload them to an FTP server after the script has finished running — the possibilities are endless!
A few other screenshot tools
Whilst these two tools are great at creating full page screen captures, there are a few other notable tools out there for taking advanced screenshots on your Mac:
- Snapz Pro – Takes various screenshot styles and can also record video
- Screenshot Plus – A fairly full featured Dashboard widget
- SnapNDrag – Click a button and drag the screenshot… very simple!
Are there any other tools or techniques you use for taking screenshots? Let me know in the comments — I’d be intrigued to hear about them.