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 This is a new version of this script Compatible with After Effects 7Compatible with After Effects CS3Compatible with After Effects CS4

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.


Last updated January 17th, 2010
3,288 views
Tags: , , , , , , , , ,

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

    3 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);

    Leave a comment

    (to reply to a specific comment use the link by the comment)