Fits selected layers proportionally to fill the Comp frame by giving you the choice of either cropping or letterboxing.

"Name Your Own Price".
You can pay anything you want, the amount displayed in the cart is only a suggested amount.
View Cart

Fit2Frame Compatible with After Effects 7Compatible with After Effects CS3Compatible with After Effects CS4Compatible with After Effects CS5Compatible with After Effects CS5.5

Version: 1.1   Sign up to be notified by email when a new version of this script is posted
Aetuts+ Rockin' Slideshow Tutorial

This script was used in this tutorial at Aetuts+

Fits selected layers (they can be different sizes and pixel aspect ratios) proportionally to fill the Comp frame by giving you the choice of either cropping or letterboxing.

Download includes 2 scripts:

  1. Fit2Frame which fits all the selected layers in a comp
  2. Fit2Frame-BatchComps which fits all layers from selected comps in the project panel

Version History

  • 1.1 – Added Fit2Frame-BatchComps to download 01/2010
  • 1.1 – Added rotation consideration 01/2010
  • 1.0 – Initial release 08/2005

Last updated January 17th, 2010
5,433 views
Tags: , , , , , , , , , , ,

Share      

About the author

I am a freelance art director and After Effects artist in New York City. I aim to provide high quality scripts that provide clever solutions for After Effects workflows.

Pingbacks

    7 Comments

    • I’m wondering if there is a way to get an image to fill the screen and be the comp size. As of now it has the option of either letter box (e.g. will make a portrait pictures height match the frame but the width will be cropped smaller) or crop (which will make the width fit but the height will still be out of the frame) for example I need to make all the layers the same size for a wall effect animation.

      Either way this script saved me a lot of time.

      Thanks

      • Are your layers rotated? Otherwise, wouldn’t Layer->Transform->Fit to Comp do the trick?
        If you have to deal with rotated images it’s very simple to modify the script to do fit to comp just let me know and i’ll modify it for you.

    • The script works incorrectly when Pixel Aspect Ratio is not Square
      It can be visible when Aspect Ratio of the Image and the Comp is near same.
      Here is the mistake:
      var myLayerAspectRatio = (myWidth/myHeight);
      var myCompAspectRatio = (myComp.width/myComp.height);
      it should be
      var myLayerAspectRatio = (myWidth*myLayer.source.pixelAspect/myHeight);
      var myCompAspectRatio = (myComp.width*myComp.pixelAspect/myComp.height);

    • Do your following scripts work in CS5?

      Audio2Markers
      PhotoOrientationFixer
      Fit2Frame

      Thanks.

    • how am i supposed to apply this?

    Leave a comment

    (to reply to a specific comment use the "Reply to this comment" link next to the author's name)

    For support related issues please contact support or post your issue in the forums