The mathematics of transforming images in Adobe Premiere - Part 1

Click For Summary
SUMMARY

The discussion focuses on the mathematical principles of transforming images in Adobe Premiere, specifically regarding the manipulation of six key parameters: Position X (PX), Position Y (PY), Scale (S), Rotation (R), Anchor X (AX), and Anchor Y (AY). When changing the anchor point of an image, users can calculate the new position values (PX2, PY2) using the formulas PX2 = PX1 + AX2 - AX1 and PY2 = PY1 + AY2 - AY1. Additionally, for scaling adjustments, the formulas become PX2 = PX1 + (AX2 - AX1) • S/100 and PY2 = PY1 + (AY2 - AY1) • S/100. These calculations ensure that the image maintains its visual position on screen despite changes in anchor points.

PREREQUISITES
  • Understanding of Adobe Premiere Pro's interface and functionalities
  • Familiarity with image transformation concepts such as scaling and rotation
  • Basic knowledge of mathematical principles related to coordinate systems
  • Experience with manipulating keyframes and parameters in video editing software
NEXT STEPS
  • Research advanced image transformation techniques in Adobe Premiere Pro
  • Learn about keyframe interpolation and its effects on image motion
  • Explore the use of expressions in Adobe After Effects for similar transformations
  • Study the impact of different anchor points on image positioning in video editing
USEFUL FOR

Video editors, motion graphics designers, and anyone looking to enhance their skills in image manipulation within Adobe Premiere Pro.

guyburns
Messages
42
Reaction score
10
There will be a Part 2 about a related mathematical problem.

I use Premiere to generate updated versions of old-fashioned slide shows. Not much video is involved, mostly stills that I transform to bring them alive – pans, zooms, rotations.

The Mathematics
In Premiere, an image appears in what I'll call the Window. Six parameters define the appearance: Position X, Position Y, Scale, Rotation, Anchor X, Anchor Y.

For my shows, the Window is set to 1920 x 1080 pixels. Let's say the image is 3000 x 1500 pixels. When the image is imported, the centre of the image appears in the centre of the Window. Here's what the parameters control, and here are the values automatically set for such an image when imported:

Position X = 960 This is where the horizontal centre of the image will be placed in the Window.
Position Y = 540 Ditto for the vertical centre of the image.
Scale = 100 Scaling (centred on the Anchor points)
Rotation = 0 Rotation (centred on the Anchor Points)
Anchor X = 1500 The point of the image which appears stationary under scaling and rotation.
Anchor Y = 750 Ditto

Shorten the above to PX, PY, S, R, AX, AY.
For a 3000 x 1500 image, only the central 1920x1080 part of it will appear in the Window. It can then be moved, scaled and rotated.

Question
Given an image anchored at a particular place with these parameters (PX1, PY1, S, R, AX1, AY1), and then I change the Anchor Point to (AX2, AY2), how do I calculate PX2 and PY2 so the image appears unchanged on screen?

When I change the Anchor Point, the image will abruptly move, but I want to bring it back to where it was by adjusting PX2 and PY2. I can do it by eye, but it takes time and is never exact.

Is there a general formula for PX2 and PY2 in terms of PX1, PY1, AX1, AY1, AX2, AY2?
Assume S and R are constant.

PX2 = ?
PY2 = ?
 
Physics news on Phys.org
Without rotation or scaling, I think you want (PX2, PY2) to be in the same position relative to (AX2, AY2) as (PX1,PY1) is to (AX1,AX2). Thus PX2 - AX2 = PX1 - AX1 so that PX2 = PX2 + AX2 - AX1, and a similar epression for PY2.

With rotation or scaling a similar principle applies, so that (PX2,PY2) is in the same position relative to (AX2,AY2) as the image of (PX1,PY1) under rotation or scaling about (AX1,AY1) is to (AX1,AY1).
 
Hey, thanks for that. I just tried it in Premier and it works, except you made a typo. The formula should have been PX2 = PX1 + AX2 - AX1.

And following your suggestion, for scaling (S in percent) I have come up with the formulaes:
PX2 = PX1 + (AX2 - AX1) • S/100
PY2 = PY1 + (AY2 - AY1) • S/100

And they seem to work. Thanks a lot.