PAL Colour

Anything not specifically related to NBTV, but at least of some technical nature that might be of interest to NBTV members. Items for sale and links to retailers do not belong here.

Moderators: Dave Moll, Steve Anderson

PAL Colour

Postby JetSetIlly » Tue Nov 26, 2024 10:57 pm

Hello,

I've been pointed to this forum by Andrew Davie who shares an interest with me in the Atari 2600. This question is about PAL TV and the Atari 2600. I'm hoping there is a television engineer here who can help.



First of all, I've been working on NTSC colour generation for an Atari 2600 emulator. I've been succesful in this and now want to move onto PAL. I'll describe my process for NTSC to give some context.

The 2600 specifies colour with a HUE value and a LUM value. To generate the YIQ signal the 2600 converts the LUM value to a suitable Y value and converts the HUE value to I and Q values.

To convert the HUE a position on the colour wheel is found like so (dividing by 15 because there are 15 possible hues)

Code: Select all
   phi = hue * 360 / 15


This is adjusted by the colour burst value, which is a fixed value

Code: Select all
   phi = phi + colourBurst


The I and Q values can then be derived:

Code: Select all
   I = Y * Cos(phi * pi/180)
   Q = Y * Sin(phi * pi/180)


In the emulator, the RGB values can then be extracted from the YIQ information in the normal way.

This generates the correct NTSC palette used by the console, created without ever explicitely specifying the RGB values, which is what I want.



My question and confusion is over PAL colour generation for PAL Atari 2600s.

I understand the PAL uses YUV rather than YIQ but I figured I could still begin the process by dividing the colour wheel by the HUE value, like I did with NTSC.

U and V can then be created from this position on the colour wheel and then the RGB values extracted from the YUV information. This is how I think U and V can be found from the position on the colour wheel

U = Y * Cos(phi * pi/180)
V = Y * Sin(phi * pi/180)

However, conversion to RGB use the YUV method does not reproduce the expected PAL palette. It's close but not it's right.

Is there a gap in my understanding of how PAL encodes colour? Is it likely that the HUE value does not indicate an equal division of the colour wheel?


This may turn out to be more of a question about the Atari 2600 but any information about PAL colour encoding will be very useful.


Thanks in advance
Stephen
JetSetIlly
"Fester, enough of the light-bulbs!"
 
Posts: 1
Joined: Tue Nov 26, 2024 9:26 pm

Re: PAL Colour

Postby Steve Anderson » Wed Nov 27, 2024 6:03 pm

Hi Stephen, another Steve here, that's how I introduce myself, though my correct (legal) name is also Stephen.

I'm in the middle of a similar process of converting RGB into YUV. Of course this involves no subcarrier and thus much easier. This is for colour SSTV based on the PD SSTV modes, but that's a different matter. Most TV's and monitors these days have some form of component (RGB/YUV) input allowing you to bypass entirely the headache of PAL or NTSC encoding and decoding - with all the attendant artifacts and resolution limitations (filters, delay lines, etc.).

This of course has all been done before, but it's possibly worth a revision today. Our resident PAL expert here, Klaas, may want to provide some input here.

Generally I'm trying to avoid any 'encoded' colour standard (PAL,NTSC or SECAM) As component (3 signals RGB/YUV and possibly separate H & V syncs), is just a few bits of wire, the composite versions are a compromise of qualiry, although very clever are hardware-wise somewhat more complex. But they do work, even if not as well as we might like.

Steve A.

Also I have had little experience in colour at component level (resistors, capacitors or semiconductors) having been interested mainly in monochrome TV in the past.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5485
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: PAL Colour

Postby Klaas Robers » Fri Nov 29, 2024 10:24 pm

As far as I remember:

Starting from R, G and B,
Y = 0.3R + 0.6G + 0.1B, (in reality the factors are two digits more precise, but I always used this approximation)
U = B - Y,
V = R - Y,

However in PAL-countries it is common practice for monitors and TV-sets to have an input for R G B (SCART) and not YUV.

But there is more..... I once had a large professional colour monitor with a professional PAL decoder and a professional NTSC-decoder, next to its R G B inputs. I then had an Apple ][ computer with only NTSC colour generation. I observed slightly different colours on NTSC (e.g. a kind of brown) than what I experienced via conversion to PAL and decoding to R G B. I think this had also something to do with different phosphors in NTSC TV's than in PAL TV's (more modern phosphors). But it is more than half a century ago that I worked in the TV technology.

The avatar (see at the right) is one of the colour pictures that was transmitted before the TV progam started. IT was used in that time to adjust the TV-set to a correct colour reproduction. For PAL only the colour saturation could be adjusted, The hue was only adjustable in NTSC sets. For PAL the hue is automatically correct.

Edit later:

I found a more precise definition for Y U V:

YUV.gif
YUV.gif (6.44 KiB) Viewed 477 times

You see how close the factors 0.3, 0.6 and 0.1 are. The extra factors for (R-Y) and (B-Y) are there to ensure that the signals U and V get a peak-to peak value of 1 (volt) when the original signals R, G and B have also a peak to peak value of 1 (volt). For Y this is also ensured.

By the way, for the SCART connector the R, G and B signals should have a PP value of 0.7 volts and not 1 volt.
User avatar
Klaas Robers
"Gomez!", "Oh Morticia."
 
Posts: 1663
Joined: Wed Jan 24, 2007 8:42 pm
Location: Valkenswaard, the Netherlands

Re: PAL Colour

Postby Steve Anderson » Sun Dec 01, 2024 11:54 am

Thanks for that more precise definition Klaas. I wonder if it's a EBU (European Broadcasting Union) standard? It's not so important here, but nice to know the source...

Living in Asia I've never seen a Scart connector on anything here, only in the UK, here it's all separate RCA/phono connectors. Five of 'em, Y,U,V plus L and R audio. Double that if the device has both inputs and outputs. Real spaghetti at the back of equipment...

Plus many devices have an Earth 'binding terminal', as many domestic properties do not have an Earth system and only 2-pin 220V US-style outlets. Using it is essential to kill hum both in video and audio. My house is all 3-pin US outlets with a proper ground/earth rod...and the grounds/earths are actually connected, often they're not.

Also, our power system is 220V/50Hz on the same US-style outlets. many other regional countries are the same except the Philippines which is 220V/60Hz, or Japan which is a mixture of 220V or 110V, both at 60Hz!

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5485
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand


Return to Off Topic

Who is online

Users browsing this forum: No registered users and 2 guests