Wednesday, 20 May 2009

Cropping, resizing and adding logos

The picture on many DVDs is letterboxed or pillarboxed. In other words, the picture frame is filled out with black bars at the top and bottom or at the sides. This is ugly, especially if you're playing a clip in a desktop window. Sometimes you want to resize the picture, maybe to fit the requirements of Youtube or to join clips from different sources together. It also can be handy to label a clip with a logo or text caption. This section explains how to do all these (and more) in one step. But unfortunately this involves re-encoding the clip, so first make sure your source clip is coded at the highest quality possible.

Cropping

I have here a clip from a film on PAL 4:3 format DVD which is framed at 1.66:1, leaving black bars at the top and bottom. I'm going to get rid of them. This is done using filters, in this case a null one.

Go to the Video menu and select Filters.... Click the Add... button to get a list of filters. Choose the null transform from the list and click OK. This is the result:

The null transform filter doesn't actually do anything to the picture, it just allows us to use the cropping function. So press the Cropping... button. To crop top and bottom use the Y1 and Y2 gadgets, for left and right the X1 and X2 ones. Keep to multiples of 8 or you can have problems playing back the finished clip. In my case offsets of 56 are just right. Below I've just cropped the top part.

Now I just need to enter 56 in the Y2 box and click OK to finish. This is the result, showing that the final frame size will be 768 x 464. Click OK and now the clip can be saved with Video -> Full processing mode switched on.

Resizing

As well as cropping I want to resize the clip to 640 x 360. This is a bit tricky as it's a different aspect ratio to the original so will need pillarboxing, ie. black bars at the sides. Cropping and resizing can be done at the same time so I'm going to go back to the original clip and start again.

Go to the Filters dialog and add a resize filter. Don't change any of the values in the resize dialog for now, just click OK and get this:

Now add the cropping just as before. Cropping is always done first, on the original rather than the resized image so the values of 56 top and bottom are the same.

Now to do the resizing. Double-click the filter to configure it. If we just wanted a half size image this would be easy - just check the Relative box and enter 50 (%) and everything's done.

In this case the target size is 640 x 360, which means changing the aspect ratio so this is a bit tricky. Check the Absolute box and enter the new dimensions. In this case we need to pad out the sides while keeping the height the same. So enter 360 as the height and the width will fix itself to an odd fraction.

Now under the Framing options section check the Letterbox / crop to size button and enter the final dimensions of 640 x 360. Use the Show preview button to confirm everything is correct.

That's everything done so click OK and now you can save the clip.

Adding a logo

To complete the clip I want to add a caption giving the title and who is in it. To do this you need to create a still image to overlay onto the video. Create this with your favourite program, in my case Paint Shop Pro.

To keep things simple, open a blank image with the dimensions of the output video, here 640 x 360. Select pure black for the background colour, and pure white (RGB 255, 255, 255) for the foreground, then write your caption / draw your logo. In my case I just want a single line of text at the bottom of the picture so this is easy. Save it in a lossless format (eg. .BMP), not .JPEG.

Now to combine this logo with the video. This should be done at the same time as the cropping and resizing to retain the best image quality. Go to the Filters dialog, click Add... and choose logo from the list. Here's how to set up the options. Both file selections are the same image I just created. There's a Preview button to keep track of what you're doing.

This is very basic. The only "fancy" setting I chose was to set the Opacity to 50%, which is easier on the eye. Using colours is not always a good idea as they tend to "bleed" on low bitrate videos. Now if the Filters dialog looks like this we're finished and ready to save the finished version:

No comments:

Post a Comment