Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
LIBRARY:TutorialsVideo TutorialsReviewsInterviewsEditorialsFeaturesBusinessAuthorsRSS Feed

Understanding the use of square vs non-square pixels in AE

COW Library : Adobe After Effects Tutorials : Rick Gerard : Understanding the use of square vs non-square pixels in AE
Share on Facebook
Understanding the use of square vs non-square pixels in AE



Understanding the Use of square vs. non-square pixels in AE

Dr. Strangepixel, or How I Learned to Stop worrying and Love the Bomb.

by Rick Gerard, Seattle, Washington USA

©2001 by Rick Gerard. All rights are reserved. Used at CreativeCow.net by kind permission of the author.


Rick Gerard

ARTICLE FOCUS:
Rick Gerard gives a glimpse of the inner workings of Adobe After Effects and explains exactly how AE mixes square and rectangular pixels. You'll never worry again about how to interpret footage. DV, HD, Wide Screen and Film comps will be a walk in the park.


Pixel Aspect Ratios

Download the project files here.

There is a great deal of confusion about Pixel Aspect Ratio. Most of the time After Effects does a great job of mixing sources if you just leave things at the default settings. It's only when you break the rules that you start to get into trouble. You have to know the rules so that you know when you've broken them.

DV footage is almost always rectangular pixels. Computer generated images are almost always square pixels. Why is there a difference? Isn't it always best to work with square pixels?

There's a difference because engineers wanted to make higher resolution television images without changing the number of scan lines and, NO, it's not always best to work with square pixels.

After Effects always works with square pixels in the Composition window. This is why rectangular pixel images look a little distorted in the Composition window. Look is a key word here. They look distorted in the Composition window but they do not behave distorted and they do not appear distorted when displayed on a video monitor. Let's simplify and de mystify this process.

Open the PixelRatio.aep project included in the project files. There are six images created at standard video project sizes and six compositions created using default settings for six different video frame sizes. Figure 1 shows the project window for two compositions containing the 640_X_480.jpg. One composition is NTSC Square pixels at 720 X 540 pixels, the other is NTSC rectangular pixels @ 720 X 486 pixels.

Figure 1. Square and rectangular pixel compositions

The circle in the NTSC SQ composition on the left appears to be a perfect circle. The circle in the NTSC Rec composition on the right looks distorted. It looks distorted because After Effects has taken the square pixels in the original image and stretched them so that the image retains its original aspect ratio. The important thing to remember here is that the pixels in the image have changed in the NTSC Rec composition, but the image has not been distorted. It only looks distorted in the Composition window. The circle is still a circle and it will behave very nicely when rotated. So, are you confused yet? We must all stick together. Listen to Dr. Strangepixel. We must work quickly or there will be a mind shaft gap. (I know how old you are if you got that joke. For those that got it, I sincerely apologize.)

Notice the little pointer at the right edge of each circle. If the footage is rotated 90° (Figure 2) and the circle is still a circle, the pointer will remain at the edge of the circle.

Figure 2. The way things look when the pixel aspect ratios are correct

The circle on the right still appears to be distorted but the edge of the circle is exactly lined up with the pointer. It must be perfectly round, and it is. It only looks distorted in the Composition window.

In this case, the footage in both compositions is interpreted correctly.

Figure 3 shows the same compositions with the 720_X_480.jpg placed in the composition. Notice that the circle now appears to be a little taller than it is wide on the left and that it appears to be correct in the composition on the right. There is a clue here. The position of the pointers has not changed.

Figure 3. Now things look wrong on the left and right on the right.

Even though the footage in the NTSC Rec composition appears display a perfect circle, the footage is distorted. It only looks right in the composition window. If the footage is rotated 90° (Figure 4) the top of the circle will swing out and touch the pointer and both images appear to be distorted.

Figure 4. Both images are now distorted.

Why did this happen? What the heck is going on. The 640_X_480.jpg and the 720_X_480.jpg were both created in Photoshop. The circle in both images is exactly 480 pixels in diameter. So why did the smaller image work in both compositions and the larger image distort in both compositions. Click on the 720_X_480.jpg in the Project window and check the thumbnail and file info. (Figure 5) After Effects has incorrectly interpreted the pixel aspect ratio of the 720_X_480.jpg as "D1/DV NTSC" because 720 X 480 is a standard D1/DV NTSC image size and should have rectangular pixels. This happens every time you import an image with standard rectangular pixel dimensions. So there's the first rule that has been broken. The image was created at the wrong size.

We can fix the problem by changing interpretation. Open the Interpret footage window by selecting the footage you want to change in the Project window and then CMND/CTRL + F click. Change the Pixel Aspect Ratio to Square Pixels. Your compositions should now look like Figure 6. The tutorial project contains several examples that you can experiment with. There is also a folder that contains copies of the 3 JPEGs that have been reinterpreted to work properly in the comps. If you play around with these files for about 10 minutes you'll never have any question of what to do about Pixel Aspect Ratios.

Figure 6. Pixel Aspect ratio changed to Square Pixels and all is right with the world again.

Working With Non Square Compositions

Some artists prefer to create all of their projects as square pixel compositions for editing. After editing is complete a new composition is created at the appropriate size and their edited composition is placed in the new non-square comp for rendering. It is not necessary to do this. It may be more convenient for you, but it is not necessary. There is no technical reason to do so. AE5's pixel aspect correction option (Figure 7) will give you a proper preview if you decide to work directly in rectangular pixel compositions. You will be presented with a warning dialogue the first time you choose this option. Follow the advice. Pixel aspect correction is not a good option to select for editing your compositions, but it will provide a properly proportioned preview.

Figure 7. AE 5's Pixel Aspect Correction option.

Let's look at the standard techniques for working with non square compositions. The first option is to create all of your NTSC artwork and your composition at the larger 720 X 540 composition size. All DV footage at 720 X 486 is forced to fit in this new composition by using the Fit to Composition option. DV footage in the time line is selected and then CMND + OPTION + F is used to stretch the footage to fill the window. The 720 vertical pixels are preserved, but they are now taller. The 486 scan lines in the original footage are stretched to fill up 540 scan lines in the composition.

WARNING
If you are going to fit DV footage into a square pixel composition you must de-interlace the video by selecting the proper field order. If you do not separate fields the footage will be soft and have a tendency to flicker in areas of high detail. The quality must also be set to "Best" to take advantage of AE's subpixel rendering.

After all editing is complete a new composition is created at 720 X 486 and the edited composition is dragged into the time line. The Fit to Composition option is used again to squish the 540 rows of pixels into 486 rows or scan lines.

Standard Image and Composition settings for DV projects:
The proper standard size for a square pixel composition that is going to be FIT into NTSC DV at 720 X 480 is 720 X 534. For Square pixel artwork that is going to be used directly in an NTSC DV 720 X 480 comp the proper size is 648 X 480. For PAL DV at 720 X 576, the proper square pixel image or comp size is 768 X 576.

For NTSC/DV widescreen at 720 X 480 the square pixel comp size is 856 X 480. For Pal DV Widescreen at 720 X 576 the square pixel comp size is 1024 X 576. Is it any wonder why PAL is the prefered format for up-sizing to Film and HDTV?

The drop dead simple way to work in a square pixel comp is to use 648 X 486 for your SQUARE PIXEL project and then just re-size to 720 X 486 NTSC/DV aspect ratio comp for rendering. AE's automatic pixel aspect ratio mixing capabilities will take over and there will be no re-sizing or Fit to Composition required. Any original DV footage used in the comp will be rendered pixel for pixel. The other drop dead simple way to work in square pixel comps and render to DV is to work with PAL footage. The default project sizes do not require you to fit your footage into the Comp. The pixel aspect ratios take care of the size mismatch automatically. If you're stuck in NTSC land, read on.

Which solution is best? That depends entirely on your footage. Before you can make an intelligent decision you have to understand what is happening to the footage at the pixel level.

Subpixel Processing

Figure 8 is a view of a test image at 400%. The alternating red, white, green, blue and black lines are exactly 1 pixel wide.

Figure 8. Color Test Image.

When the image is placed in a Square pixel composition, every pixel remains unchanged. When the image is placed in a rectangular composition some strange things begin to happen.

Figure 9 is the same image placed in a NTSC DV pixel aspect ratio composition. The quality is set to "Best" to enable subpixel rendering. After Effects stretches the pixels to maintain the proper aspect ratio of the original illustration, but in doing so the vertical color stripes are dramatically changed.

Figure 9. Square pixel footage in a Rectangular pixel composition.

There is also a subtle change in the diagonal lines. After Effects subpixel rendering is responsible for the change in color of the vertical lines. The original square pixel has been stretched to 1.1 times its original width. There is really no way to render a tenth of a pixel so After Effects has to decide what color to make two pixels that contain this oversized pixel and the one next to it. A little math happens and voila, a brand new pair of pixels are created, neither of which are the same color as the original. What does this mean? Why is there no change to the horizontal lines? Are my original graphics going to be all screwed up because I'm mixing pixels aspect ratios? I know! I'll just create a square pixel comp and everything will be just fine.

Not so fast. If you're going to create a square pixel comp and use DV footage it's going to have to be stretched to fill the comp window. You end up a with a new set of problems demonstrated by Figure 10.

Figure 10. Rectangular pixel footage in a square pixel composition.

Now the horizontal lines are fouled up and the vertical lines are ok. Wait. Something strange is going on here. The horizontal and vertical lines are changing dramatically but the diagonal lines look just about the same in both examples. When you mix square and rectangular pixels in a composition something has got to give. New pixels are going to be created in the composition and the original image will be changed.

Lets take a close up view of exactly what happens to the pixels. In Figure 11 each square in the grid represents one composition pixel. When a 720 X 540 composition is fit (CTRL + ALT + F or CMND + OPTION + F) to a 720 X 486 composition, the original pixels are reduced in height by 10%. After Effects must assign a value to each composition pixel. The value is calculated by taking the value of the source pixel and factoring in the percentage of the composition pixel that is filled by the source pixel. Sounds complicated doesn't it? It's not really. When a 100% black source pixel is reduced in height by 10% the new value for the composition pixel is 90% black. If a 100% black pixel occupies 50% of a Composition pixel the new value for the composition pixel is 50% black. I suggest that you step through the movie in Figure 11 a frame at a time and carefully observe what happens to square pixels when they are added to a rectangular pixel composition.

Figure 12 is the original square pixel image. Figure 13 is the result of fitting a 720 X 540 comp into a 720 X 486 composition. Figure 14 is the result of placing a 648 X 486 image in a 720 X 486 composition. A blue background was used to make it easier to see the the lighter colored pixels that AE creates.

Figure 12. The original image.

FIgure 13. Fitting 720 X 540 into 720 X 486.

Figure 14. Using a Square pixel image in a rectangular pixel composition.

There you go. Now you completely understand subpixel rendering. It looks much more frightening than it is because fortunately, real images used in projects are not made up of repeating patterns of single pixel lines. It is nearly impossible to detect the subtle changes that happen to an image when pixel aspect ratios are mixed. Any time you change the scale of an image, pixel values have to change. It happens in Photoshop and it happens in After Effects. The reason for this little exercise is so you can make a better decision about which level of detail you wish preserve. If horizontal detail is most important, then scale your DV footage up in a 720 X 540 comp, place your square pixel artwork in the composition and then Fit the working comp into a 720 X 486 comp for rendering. If it is more important to you to preserve the scan lines then work at 648 X 486 or directly in 720 X 486. I have included the ColorTest.tif in the project files. I've also included a vector resolution chart called EIA1956.ai. You can experiment with various pixel aspect ratio projects and see how they react. Watch what happens when you switch the quality settings back and forth. You might want to create a short movie of the resolution chart using rectangular pixels and then test working at various square pixel composition sizes. I think you'll be surprised. It takes very careful scrutiny and a scope to see any difference in the resolution of the rendered footage.

A final note: AE defaults to preserving the scan lines with both NTSC and PAL footage. You have to make AE preserve the horizontal pixels by creating an over sized composition and Fitting the footage into your composition. If you work in Pal, you really have no choice. A square pixel Pal comp will hold rectangular pixel pal footage perfectly. There is no forcing required.

I prefer to preserve the scan lines when working on projects where I am not going to de-interlace the footage. Ailiased diagonal lines and artifacts in DV footage tend to be emphasized if you work at 720 X 540 and scale or reposition the footage. I prefer working at the larger comp sizes when there is a great deal of horizontal detail in the graphics. Interlace flicker seems to be reduced because the horizontal edges of my graphics are softened by the automatic compensation that AE makes when the project is forced to the smaller 720 X 486 comp size. If I am working on an television spot and the type has to be 20 scan lines high I always work at 648 X 486. I'm preserving the scan lines and I don't have to do the math to calculate how many scan lines at 720 X 540 equal 20 scan lines at 720 X 486. I also have found that fine text is much less likely to flicker if it is positioned exactly on a scan line. You can't do that when you're going to blend your rows of pixels into scan lines by squishing them from 540 to 486.

The most important thing to remember about all this pixel aspect ratio stuff is that you must know the pixel aspect ratio of your original footage. After Effects will properly mix any combination of pixel aspect ratios from DV Wide Screen to D4/Anamorphic if your original footage is interpreted correctly. Check it with the info at the top of the Project window. If it is wrong, change it. DO NOT create square pixel graphics at standard rectangular pixel footage sizes. Don't change the pixel aspect ratio when you create a new composition unless you have a specific reason to do so. The defaults are correct. You shouldn't have to mess with them. Do this and you can work in any comp with confidence and your pictures will never be distorted.

The project files are here in zip format.

Rick Gerard is a frequent visitor and contributor to the Adobe After Effects COW. Pop in to comment on this article or ask questions. Like to see who Rick is and find other articles that he's contributed? Click here.

###


  View 2 Comment(s)

  Adobe After Effects Tutorials   •   Adobe After Effects Forum
Reply   Like  
Share on Facebook
Comments

Re: Understanding the use of square vs non-square pixels in AE
by Max Cohen
I second what Michael Wells was asking about.
Adobe is getting into the M$ habit of making older versions of files useless to newer editions so people are always buying the lasted versions.
Re: Understanding the use of square vs non-square pixels in AE
by Michael Wells
This was very interesting. I wanted to experiment with the files so I can really wrap my mind around what you are sharing because I must admit it was a lot to absorb. However when I tried to open the downloaded file I got a message saying it was created in an older version of AE and I would need to open it in the older version and then resave it. Unfortunately I don't have an older version than the one I am currently using. Is it possible to have an updated AE file posted.


Related Articles / Tutorials:
Adobe After Effects
Zero VFX: Why Some Effects Are Better Unseen

Zero VFX: Why Some Effects Are Better Unseen

Kyle Andal and Gerard Andal, lead compositors at Zero VFX, bring invisible post-production magic to several films - including 2014 Academy Award-winning "American Hustle," in which the team helped transform 2013 Boston to 1978 New York - and also several commercial shots with mocha Pro.

Editorial, Feature, People / Interview
Adobe After Effects
LightGrid Script and Demo Tutorial Part TWO with New Feature

LightGrid Script and Demo Tutorial Part TWO with New Feature
  Play Video
LightGrid Script creator Brian Charles demonstrates his newly modified After Effects script for rigging lights in grids and circles. The modified script with the new feature, which adds the ability to enable individual light colors through a checkbox in the effect control panel, is available as a free download in the Project Files folder.

Tutorial, Video Tutorial
Adobe After Effects
Green Screen Billboard Compositing

Green Screen Billboard Compositing

This After Effects tutorial demonstrates how to simulate augmented reality centered around a city billboard by compositing green screen footage and editing it into the scene.

Tutorial
Adobe After Effects
After Effects Handwriting Tutorial

After Effects Handwriting Tutorial

This tutorial will show you how to create an animation of a marker writing out a logo or a few words, followed by a slick reveal to an actual logo.

Tutorial
Adobe After Effects
LightGrid Script and Demo Tutorial

LightGrid Script and Demo Tutorial
  Play Video
LightGrid Script creator Brian Charles demonstrates his After Effects script for rigging lights in grids and circles. The script is available as a free download in the Project Files folder.

Tutorial, Video Tutorial
Adobe After Effects
mocha Tracks The Wolf of Wall Street

mocha Tracks The Wolf of Wall Street

With multiple VFX Oscars (Hugo and Titanic, plus a nomination for Apollo 13) plus a couple of Emmys (Star Trek: The Next Generation and Star Trek: Deep Space Nine) under his belt, the most remarkable thing about Rob Legato's latest VFX extravaganza is that it doesn't appear to have any VFX at all! Martin Scorsese's The Wolf of Wall Street is a masterpiece of what has become known as invisible effects, and this article from our friends at Imagineer, highlighting Rob's work with mocha, is a real eye-opener.

Editorial, Feature
Adobe After Effects
Klip Collective Pushes Film Into New Spaces At Sundance

Klip Collective Pushes Film Into New Spaces At Sundance

Projection mapping installation relies on Adobe Creative Cloud tools to create stunning visuals for the Sundance Film Festival entry, "What's He Building in There."

Editorial, Feature, People / Interview
Adobe After Effects
Joseph Kosinski’s Film “Oblivion” Showcases Elegant Effects

Joseph Kosinski’s Film “Oblivion” Showcases Elegant Effects

World‐class user interface designers, graphic artists, and animators create crisp, timeless visual elements for the sci-fi film starring Tom Cruise and Morgan Freeman, Oblivion. Kosinski turned to Bradley G. Munkowitz (GMUNK), whom he'd previously worked with on Tron Legacy. As lead interface graphic designer, GMUNK then pulled a team together that included Interface Graphic Designers Joseph Chan (Chanimal) and Jake Sargeant, and Interface Animators Alexander Perry (AP), Navarro Parker (Nav), and David Lewandowski (D-Lew). They were happy to reunite to share how much fun they had creating the 2D effects for the film using an Adobe workflow.

Editorial, Feature, People / Interview
Adobe After Effects
VFX & Motion Graphics on Star Trek: Into Darkness

VFX & Motion Graphics on Star Trek: Into Darkness

Andrew Kramer of Bad Robot and author/owner of the site Video Copilot was tapped to create more than 30 title sequences for the resurrection of the classic science fiction franchise with Star Trek: Into Darkness, while the OOOii team created stunning graphics and heads-up displays for the blockbuster film. OOOii CEO Kent Demaine, Lead Designer Jorge Almeida and Andrew Kramer shared their great experiences working on the latest seminal Star Trek film.

Editorial, Feature, People / Interview
Adobe After Effects
Delivering Content for TV's Top Shows

Delivering Content for TV's Top Shows

Delivering content for some of television's top shows, including House of Lies, Grey's Anatomy, and, of course The Walking Dead, Stargate Studios continues to break the mold of how feature films, television series, electronic games, and commercials are generated. In this article, read how Adobe Creative Cloud and automation create a competitive edge for the iconic production studio, Stargate Studios.

Editorial, Feature, People / Interview
MORE


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]