What do you do when your QuickTime movie has ugly artifacts around the borders? Use QuickTime Pro’s unlikely Mask feature to slice ’em off. Here’s how.

For the recent O’Reilly Digital Media feature on composing music for mobile games, author Peter Drescher sent several movies of expert gamer Lucas Finklestein playing on a T-Mobile Sidekick. Due to the camera position, though, the movies had enormous black borders. Not only did that look strange, the borders bloated the file size. (See Figure 1.)

Fig. 1: Original movie

Fig. 1: The original movie had big, ugly black borders, but QuickTime Pro’s Crop command snips out time, not area. What to do?

It would be nice if QuickTime Pro let you crop a movie by dragging the edges inward. But the actual solution is to cover the borders with a white mask. Once you do that, the movie shrinks to the size you want, and you can export it as a new movie. I shrunk the file in Figure 1 from 8.8MB to 2.7MB.

Choosey Mothers Choose GIF

To begin, I copied a single frame of the movie by scrolling to the spot I wanted and then pressing Command-C. (You can also use QuickTime Pro’s export command to export the frame as a PICT file.) I then pasted the frame into my graphics editor, Macromedia Fireworks.

Next, I set Fireworks’ canvas color to white and drew a black box over the part I wanted to keep. (See Figure 2.) Then I deleted the photo layer and exported the black-box-on-white-background as a GIF.

Fig. 2: Drawing the box

Fig. 2: After copying a single frame of the movie and pasting it into Fireworks, I drew a black box around the part I wanted to keep. (I made the box gray and semitransparent in this screenshot so you could see the background.) UPDATE: See comments below for more detail on this step.

Back in QuickTime Pro, I pressed Command-J to open the Properties window. Then I selected the video track and imported the GIF mask file. (See Figure 3.)

Fig. 3: Importing the mask

Fig. 3: In QuickTime Pro, open the Properties window, select the video track, and then choose your mask file with the Choose button.

As soon as you import the mask, the metallic QuickTime Player frame closes in like the Death Star trash compactor. (See Figure 4.) It’s just a cosmetic change, though, because simply saving the movie won’t change the file size. To make the cropping permanent, you need to export the movie. I opted to use stronger compression to shrink the file more.

Fig. 4: The movie, cropped

Fig. 4: With the mask in place, the QuickTime frame has closed down on the hapless black border.

QuickTime Unmasked

You can see the final movie on page 2 of Peter’s article. Note that the mask I used there is rather oblong, because the camera jumped to the side partway through the movie. I could have split the movie into two files, applied custom masks, and then recombined the halves, but the morning birds were already singing.

For more QuickTime masking tricks, see Dan Slagle’s article (which includes downloadable masks), or this one where the editor used a mask shaped like a football for a special effect.