PAL VHS

After having a look at what PAL looked like on images that were broadcast to your television or arrived from a home computer, I wanted to have a look and see if I could simulate how a PAL VHS image would be mangled.

From what I could gather, a PAL VHS picture was 576 lines but it only stored a maximum horizontal resolution of around 333 pixels. On the back of an envelope I worked out that meant that the image stored on a VHS tape had about 46.25% of the horizontal resolution of a broadcast PAL image.

Therefore, suppose the original image was this Telefusion Yorkshire one (click to see it at full size):

Before: the original 720 x 576 pixel image

Then it would be stored as this much red information (click to see at full size):

Red – 100 x 576 pixels

This much green information (click to see at full size):

Green 195 x 576 pixels

and this much (or, rather, little) blue information (click to see at full size):

Blue 38 x 240 pixels

And when combined you’d get an image like this:

After: Simulated PAL VHS image

Incidentally, PAL images have non-square pixels. So in order to see the “before” and “after” images on this page in the correct aspect ratio I have scaled them horizontally from 720 pixels up to 788 pixels.

PAL with telly

After re-reading Alan Pemberton’s article on PAL, I realised I’d been a right numpty in my post about recreating the effect of PAL on images.

I re-read the following:

Y = 0.299R + 0.587G + 0.114B

A light bulb went on, and I realised I’d been completely wrong in the way I was scaling my Red, Green and Blue images before combining them. This also meant that the Gaussian Blur step was not needed.

What I needed to do to with the colour channel images I made from my initial 720 x 576 images was to horizontally scale them in The GIMP by following amounts:

  • Red to 720 x 0.299 = 215 pixels
  • Green to 720 x 0.587 = 423 pixels
  • Blue to 720 x 0.114 = 82 pixels

Here’s the logo I created for my friend Greg Taylor’s company before:

Before image. Can you spot Emily Moore?

And here it is after using this revised method:

Now with PAL – click to enlarge the images

I’m sure I’ll come back to this again, but I’m finding it interesting.

Simulated PAL

One of the many mysteries of having a home computer as a teenager was why the picture looked so much better on colour monitor than it did on a domestic television. And indeed, why the image on a domestic television looked sharper if you turned down the colour.

Later on, I discovered it was due the PAL system that the BBC Micro used to send pictures to the television. PAL ingeniously chucks away loads of colour information in order to keep the bandwidth of analogue colour television pictures down to a level that made broadcasting them practical.

After reading an excellent article on the subject by Alan Pemberton, I thought I’d have a go and see if I could simulate what PAL does to an image in The GIMP.

As a starting image, I used a CEEFAX page I’d made in Teditor (by Jim Notman, The Micro User, Volume 2 Issue 6) on the BBC Micro emulator BeebEm. Obviously teletext looked nothing like as good as this on a domestic television.

My starting image – click to enlarge. It never looked this good on a telly!

To begin with I added a Gaussian Blur to the image. I broke the link between the horizontal and vertical blur radii so that I blurred more horizonally (2.2) than vertically (1.2). It’s worth playing with this.

This button breaks the link between the radii

The next thing I needed to work out was how to split the image up into three different images – one containing red, one containing blue and one containing green. I discovered the Levels dialog box in The GIMP would do this for me.

To make the Red channel I created a duplicate of my original image with Ctrl+D. Then I brought up the Levels dialog box and then:

  1. selected blue channel from the Channel combo box
  2. dragged black pointer below the input levels graph to far right
  3. selected green channel from the Channel combo box
  4. dragged black pointer below the input levels graph to far right

The Red channel

To make the Blue channel I created a duplicate of my original image with Ctrl+D. I brought up the Levels dialog box and:

  1. selected red channel from the Channel combo box
  2. dragged black pointer below the input levels graph to far right
  3. selected green channel from the Channel combo box
  4. dragged black pointer below the input levels graph to far right
The Blue Channel. Sounds a bit rude…

Finally, I made the green channel from my original image. To do this I:

  1. selected green channel from the Channel combo box
  2. dragged black pointer below the input levels graph to far right
  3. selected blue channel from the Channel combo box
  4. dragged black pointer below the input levels graph to far right

That meant I had three images – one which was the red channel, one which was the blue channel and one which was the green channel.

The green channel was finished – I didn’t need to touch this as the PAL system relies on a high resolution green image and adds a low resolution red and blue image to this.

The finished Green channel. It will not be scaled like Red and Blue.

However, to both the red and blue channels I needed to lower the horizontal resolution quite drastically. Therefore I scaled both images to be 197 x 576. Then scaled them both back to 788 x 576 – their original size – again.

The Red channel after being scaled

Next I copied both the red and blue images into the green image as new layers. I used the Addition blend mode in the Layers, Channels, Paths dialog box to blend the images together.

Here is the low resolution red image added to the high resolution green image.

Red and Green images on separate layers blended using “Addition”

Here are the low resolution red and blue images added to the high resolution green image.

The end result – click to enlarge.

Well, it’s not perfect, but it was nearly what I was after and I was over the moon.

With a bit of playing around with the way you scale the channels it’s possible to get a fairly realistic PAL effect. The image below has various filters added to it, and I think it looks like an almost passable knock off of an off-screen photo.

Click to enlarge. Needs a bit more work, I think.

What I want to do next is to turn this into a filter in Python to automate the process and allow it to be fined tuned.