B The mathematics of transforming images in Adobe Premiere - Part 1

AI Thread Summary
The discussion focuses on the mathematical parameters used in Adobe Premiere to transform images for slide shows, specifically how to adjust position when changing the anchor point. Six key parameters define the image's appearance: Position X (PX), Position Y (PY), Scale (S), Rotation (R), Anchor X (AX), and Anchor Y (AY). When changing the anchor point, a formula is needed to calculate the new position (PX2, PY2) to maintain the image's appearance on screen. The derived formulas for adjusting position based on anchor changes are PX2 = PX1 + (AX2 - AX1) • S/100 and PY2 = PY1 + (AY2 - AY1) • S/100. This mathematical approach allows for precise adjustments in Premiere, enhancing the transformation of still images.
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 = ?
 
Mathematics 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.
 
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...

Similar threads

Replies
1
Views
410
Replies
6
Views
3K
Replies
2
Views
3K
Replies
2
Views
4K
Back
Top