
Some pixels in the standard-def video world (specifically, the digital electrical signals universally used in studios for 480i and 576i production, as defined by the infamous ITU-R BT.601-4 or "Rec. 601") are non-square. A 100 pixel vertical line may be longer or shorter than a 100 pixel horizontal line on a video monitor, depending on the video system.
Pixels in the HD (e.g. 1080i and 720p) video world are, fortunately, square.
The term which describes this squareness or non-squareness is pixel aspect ratio, expressed as a fraction of horizontal (x) pixel size divided by vertical (y) pixel size. The pixel aspect ratio for square pixels is 1/1.
Any rendering of geometry-based graphics to an image, including text, must take the pixel aspect ratio into account, otherwise it will come out "stretched" or "squished."
Many image processing operations assume a certain pixel aspect ratio. For example, a blur operation with a radially symmetric kernel may look bad on non-square pixels.
| System | hSpacing | vSpacing |
|---|---|---|
| 480i | 10 | 11 |
| 576i | 59 | 54 |
You can think of these values as the ratio of the width of a pixel to the height of a pixel. For example, say you want to draw a circle that appears round on the display device and whose diameter is n horizontal pixels (luma sampling instants). Draw an ellipse which is n pixels wide and
For a full explanation of where these values come from, please read:
What Pixels are Square? How Non-Square is Non-Square?
This happened before almost any video software got written.
The problem was, software folks like us didn't realize that. What ensued was a melee of confusion and religious wars about what the pixel aspect ratio was, that took place at the library (QuickTime, Video for Windows, DirectShow, ...), application (Premiere, Final Cut, After Effects, ...) and documentation (Video Demystified, ...) level.
There's some details on the confusion in this section of my document on video systems.
Furtheremore, you may have noticed that non-square data tends to come in buffers that are 640 pixels wide (480i video system) or 768 pixels wide (576i video system).
So why, you might ask, isn't the pixel aspect ratio of 480i video equal to 720/640?
And why, you might ask, isn't the pixel aspect ratio of 576i video equal to 720/768?
The answer is that that is not the criterion the video engineers used to choose the pixel aspect ratio. For all the sordid details on that, please read this section of my video systems introduction.
Put another way, "How do I deal with this math:"
The answer to this excellent question is that a 720-pixel-wide non-square pixel image and a 640- or 768-pixel wide square pixel image do not represent the same horizontal range of the underlying signal!
| 480i 720 non-square pixels | 576i 720 non-square pixels |
When converting, you need to scale by 10/11 or 59/54 and then pad or crop. We'll give you the details below.
To understand exactly what we mean by "underlying signal" (you're probably thinking "What do you mean? The edge of the image is the edge of the image!"), I recommmend that you pop over to learn some of the shocking secrets about video signals on this page:
Programmer's Guide to Video Systems
| 480i Non-Square Sampling 720 x 486 | 576i Non-Square Sampling 720 x 576 | |
|---|---|---|
| ↓ scale horizontally by 10/11 ↓ 654 6/11 x 486 ↓ crop to 640 ↓ | ↓ scale horizontally by 59/54 ↓ 786 2/3 x 576 ↓ crop to 768 ↓ | |
| 640 x 486 480i Square Sampling | 768 x 576 576i Square Sampling |
When you crop, you should keep the image centered.
Here is how to convert a 640- or 768-wide square image into a 720-wide non-square image:
| 480i Square Sampling 640 x 486 | 576i Square Sampling 768 x 576 | |
|---|---|---|
| ↓ scale horizontally by 11/10 ↓ 704 x 486 ↓ pad to 720 ↓ | ↓ scale horizontally by 54/59 ↓ 702 54/59 x 576 ↓ pad to 720 ↓ | |
| 720 x 486 480i Non-Square Sampling | 720 x 576 576i Non-Square Sampling |
"Pad" means need to pad the image out to 720 non-square pixels, keeping the image centered. A better way to do it, if you can, is to start with a greater number of square pixels than 640 or 768 (again with the same horizontal center), and scale those directly to 720.
A video input or output device which is encoding or decoding an analog signal will never need to pad or crop: it can measure or synthesize the continuous analog signal for each video line any way it wants. Each analog video line is long enough to accomodate either horizontal range.
| Like It? | Like what you see on this site? Want to see more in the future?
| ||||||||||
| Google Ads | |||||||||||
| Shameless Plugs | If you find this information useful or entertaining, consider browsing these shameless plugs for things that me and my friends to do earn a living. | ||||||||||
![]() | mapfling.com: free custom maps with your own labels Party? Meeting? Request a map, label it yourself, and easily fling it to your friends! | ||||||||||
![]() | world's stupidest everything See some of the worst the world has to offer, and add some of your own! World's Stupidest Holiday and Birthday Presents - stupidest-presents.com | ||||||||||
![]() | lurkertech: video tech and diversions Buzzword bingo, bill the borg, MEZ, lurker's guide to video, and Thai, oh my! | ||||||||||
![]() | slice-of-thai.com Tasty morsels of information on Thai food, language, culture, and general silliness. | ||||||||||
![]() | thailand fever I co-authored this bilingual cultural guidebook to Thai-Western romantic relationships. | ||||||||||
![]() | thai-english software dictionary Check out my Thai-English, English-Thai dictionary for Palm OS® PDAs. | ||||||||||
![]() | allaboutpai.com A site about Pai, my peaceful home in the mountains of Northern Thailand. | ||||||||||
![]() | thailand your way Travel with my friend Nang, who is a great nature, birding, and cultural guide. | ||||||||||
![]() | jeed illustration My English-fluent Thai friend Jeed is a freelance illustrator who is available for hire. | ||||||||||
| Copyright | All text and images copyright 1999-2008 Chris Pirazzi unless otherwise indicated. | ||||||||||