Better window screenshots

For some time now, I’ve been using a homemade utility, snapflickr, for taking screenshots and automatically uploading them to Flickr. It worked really well for most screenshots, but there were some, like this one from yesterday’s post,

Character Viewer

that just don’t look right because the desktop background border is either too thin or uneven or both. Today I updated snapflickr to fix that.

The problem arose because I was including the drop shadow in window screenshots. There are some, like Dan Benjamin, who think this is an abomination. I agree that the shadows are too big, but don’t like the “open” edges of window screenshots that don’t have the shadow.

Character Viewer bare

On a white background, it looks like contents of the window are going to fall out.

As a compromise, snapflickr took screenshots with the shadow, cropped them down to a more reasonable size, and then composited them on top of a Solid Dark Aqua Blue background color. This worked fine for most windows, which have standard sized shadows, but palette and other utility windows often have smaller shadows. Cropping that looked fine on a normal window looked like shit on a palette window. I tried less cropping for palette windows, but apparently they don’t all use the same size shadow. As you can see from the top screenshot, the lesser cropping didn’t always lead to nice results.

So now snapflickr takes a different approach to window screenshots. It doesn’t include the shadow but adds a 16-pixel border around the outside to provide definition.

Character Viewer with background border

This looks good with any type of window and is what I should have done from the beginning.

Because I sometimes use snapflickr to take screenshots of a rectangular area instead of a window, I needed to add an option not to include the border. That wasn’t too hard.

snapflickr dialog

The border is selected by default, because that’s what I want most often, but it can be turned off if necessary.

The snapflickr source code is in this GitHub repository. It requires the Python Imaging Library to add the border, Carsten Blüm’s Pashua application/library to display the dialog, and Sybren Stüvel’s Flickr API module to do the uploading.