# Creative Communities of the World Forums

The peer to peer support community for media production professionals.

• # Flexible scale

Posted by on October 24, 2023 at 1:25 pm

Hello again everyone. Please tell me what expression can allow you to save the filling of space in the composition with an object (dog meme) depending on its size. For example, with FullHD the scale is 100%, but when I increase the composition to 4K, the dog becomes small, the logic is clear to me. How to make sure that as the size of the composition increases, the dog automatically changes its scale so that it looks the same size as in FullHD?

4 Members · 7 Replies
• 7 Replies

October 24, 2023 at 2:59 pm

There is way, but I have to ask, do you have mulitple comps sizes or is it always from 1920 to 4000. This matters because the simple solution is to just multiply the scale by 2.08334. There would be no reason to write all the complicated code if it is always this ratio. let us know.

There are a few ways to accomplish this, and I guess we would need to know if the position or scale is already animated.

I mean, you could also drag the whole comp into a 4000 comp, and fit to fill, and just click continously rasterize to keep the full quality of the original pics inside.

• ### Dan Ebberts

October 24, 2023 at 3:52 pm

A scale expression like this might be all you need:

`value*thisComp.width/1920`
• ### Smet Kira

October 25, 2023 at 1:09 am

Thank you very much, it works as always! And if the situation is real, as Adam wrote above. If the proportions of the composition will change, for example, 1:1 or 8:3…can this be automated?

• ### Dan Ebberts

October 25, 2023 at 4:11 am

I would think so, but you’d have to define the rules for what should happen in such cases.

• ### Smet Kira

October 25, 2023 at 5:12 am

Understood. Thank you. Try using the conditions.

• ### Andrei Popa

October 25, 2023 at 6:32 am

If you want to keep the scale constant in comparison with the smallest measure of the comp (width/height), you could use this:

`value*Math.min(thisComp.width/1920, thisComp.height/1080)`

If you now change your comp to 1920×1920, the image remains the same. I would choose to stick with the smallest of the 2 measurements (width/height) so I am sure that the image is never larger than the actual comp

• ### Smet Kira

October 25, 2023 at 7:04 am

many thanks, useful!)

We use anonymous cookies to give you the best experience we can.