w = thisComp.width;
h = thisComp.height;
function gcd(a, b) {
return (b == 0) ? a : gcd(b, a % b);
}
g = gcd(w, h);
(w / g) + ":" + (h / g);
Calculates your composition’s aspect ratio by finding the greatest common divisor (GCD) between width and height, then displays the simplified format like 16:9, 1:1, or 9:16. Ideal for workflows involving multiple deliverable formats where maintaining correct ratios is crucial.
Contributed by:
Quickly confirm and display aspect ratios in adaptive templates, after effects automation, and multi-format video exports.