Skip to main content
Inspiring
November 14, 2018
Answered

How do I scale a masked image smaller than the comp to fit the comp fully?

  • November 14, 2018
  • 4 replies
  • 7314 views

Hi all,

Long time AE user here, but can't seem to figure this one out; hoping you guys can lend a hand and help me out

I have a video clip of a sign in front of a building (The sign takes up about 25% of the frame).

I exported a still image of the sign and in Photoshop, made the sign say something else, then deleted everything around the sign so it's just an alpha channel. So now I have a PSD that's 1920x1080 with a single layer of the sign that only takes up 25% of the frame, so that I can composite it.

Then I imported the Photoshop file into AE along with the original footage.

Using Mocha AE, I tracked the footage of the sign, then in AE, made a Solid layer, pasted the tracking data onto it using corner pin, then Precomped the solid layer as 'leave all attributes'.

The solid layer follows the track perfect, so we are good there.

Inside the precomp, I add my photoshop layer (That has the replaced sign). In order for the new sign psd layer to composite properly over the sign footage, the 25% sign needs to fill 100% of the precomp (Since 75% of the sign PSD is an alpha channel). At this stage, watching the main comp, the replaced sign layer is being tracked, but it's much smaller and is not following it perfectly (Since inside the precomp, it hasn't been stretched to full screen.

I can do it roughly by adding another corner pin to the psd inside the precomp and stretch it up to the corners, but it's messy as I need to put the 4 corners WAY past the actual comp size. It doesn't do a perfect job and it takes a while to get it close to the right spot.

Is there anyway to stretch the psd layer (Not the 1920x1080 canvas size of the psd, but rather the exact size of the sign), so that it fits the precomp perfectly?

Thanks!

This topic has been closed for replies.
Correct answer Rick Gerard

That's what I was trying to figure out; how to stretch the file in AE, or in Photoshop. I tried AE and it was taking a while, but I eventually did it. In my reply #9, I was asking how to do that.

Your example is similar and what you've explained answers my question so thank you.

I just filmed a mockup to try and explain it better, but it looks like you've provided a better way in your recent post, so thank you.

here's a mock up I just filmed of the scene. It includes 1 clip of an applebox with some tape on it to resemble the sign I was working with. I exported a still frame of it and then used it to create a new sign. You'll see with my new sign within the photoshop file that the task I had to do was to have nothing in the bottom sections, and to move the bottom sections up to the top. (The Photoshop file consists of the original exported still frame as well as the replaced sign I made using the original.

https://drive.google.com/drive/folders/1rXL825zw9C5-hEulV2KH6LRtyeFHWLWU?usp=sharing

Your workflow would be to stretch in Photoshop for this as well?


Thank you


For that shot, I would never go to Photoshop unless I needed the original background of the sign. Let's say that was the case. Here's the project what I would do.

  1. Pick a frame where the side of the apple box was as close as it gets to square to the camera.
  2. Export a frame as a PSD
  3. Draw a mask around the edge of the apple box
  4. Duplicate the layer using Ctrl/Cmnd + j to get a copy with just the cut out apple box
  5. Change to the selection tool (v) and transform the apple box to square it up to the frame using the Ctrl/Cmnd key to move the corners
  6. Add the new sign elements in another layer
  7. Save the PSD, import it to AE and drop it in the timeline above the footage
  8. Select the footage layer in AE and choose Track In Mocha from the Animation Menu (or from the Effect Menu in the latest version)
  9. Draw a spline around the outside edge of the Apple Box and track
  10. Adjust the surface to include the same area that I used in Photoshop
  11. Check the track to make sure it was good by adding an image like the 8 X 8 grid to the surface
  12. Export the corner pin data, or copy or just apply directly from the Effect Control Panel to the PSD

All done, all through. Just for fun, I'll give it a try a little later today. It should take about 10 minutes.

Edit: Took me 7:44...

Here is the workflow.

If all I needed was to add a text layer with a blend mode I could have eliminated the photoshop file entirely.

4 replies

Mo Moolla
Legend
November 14, 2018

Here is another workaround thats pretty much hidden and that most people never get to see but is built into AE

Select File -->Scripts-->Demo Palette. This will open up a palette with a scale comp functionality. Select your comp in the timeline and presto. Very easy to use

Let me know

Mo

Will..Author
Inspiring
November 14, 2018

Interesting! You're right. I've been using AE for a long time at different companies working on many different projects and never knew about this

I will try it out and report back!

Thanks.

Will..Author
Inspiring
November 18, 2018

For that shot, I would never go to Photoshop unless I needed the original background of the sign. Let's say that was the case. Here's the project what I would do.

  1. Pick a frame where the side of the apple box was as close as it gets to square to the camera.
  2. Export a frame as a PSD
  3. Draw a mask around the edge of the apple box
  4. Duplicate the layer using Ctrl/Cmnd + j to get a copy with just the cut out apple box
  5. Change to the selection tool (v) and transform the apple box to square it up to the frame using the Ctrl/Cmnd key to move the corners
  6. Add the new sign elements in another layer
  7. Save the PSD, import it to AE and drop it in the timeline above the footage
  8. Select the footage layer in AE and choose Track In Mocha from the Animation Menu (or from the Effect Menu in the latest version)
  9. Draw a spline around the outside edge of the Apple Box and track
  10. Adjust the surface to include the same area that I used in Photoshop
  11. Check the track to make sure it was good by adding an image like the 8 X 8 grid to the surface
  12. Export the corner pin data, or copy or just apply directly from the Effect Control Panel to the PSD

All done, all through. Just for fun, I'll give it a try a little later today. It should take about 10 minutes.

Edit: Took me 7:44...

Here is the workflow.

If all I needed was to add a text layer with a blend mode I could have eliminated the photoshop file entirely.


Thank you Rick for recording and sharing that! I was doing everything correct, except for not scaling/distorting the sign on the Photoshop file itself before working in AE. It's much easier scaling it in Photoshop as you've shown

I've marked your reply as correct and appreciate all of your help!

Thank you!


Will

Mo Moolla
Legend
November 14, 2018

"Your replacement sign needs to be the same size as the composition frame for corner pin to work"

This is 100% correct

Will..Author
Inspiring
November 14, 2018

Yes, I understand. I'm not asking that though. I'm sorry for not explaining it well. My tracking data is perfect, there's no issue with that, there's also no issue with the precomp where the cornerpin data is. I'm asking about a way to make an image that's smaller than the documents frame size be as big as the comp. To make the actual corners of the sign within the frame scaled to match the corners of the comp.

For example, the image below shows a canvas size in photoshop of 1920x1080, but the blue shape is much smaller. Yes, I understand that the blue shape needs to be as big as the comp in order for the track to work properly. That's what I'm trying to do. I created my own version of the sign, using the still frame from the footage, so the result is that the new sign is exactly the same size as the original sign (because I used parts of the original sign to make the one one.) Now I'm trying to figure out a way to easily make the sign the full canvas size, either in photoshop, or by importing it into AE and doing it there:

Mo Moolla
Legend
November 14, 2018

2 ways:

1. In PS change the image size to got the comp or

2. Take the sign into AE, create 1080p comp and revise there

Martin_Ritter
Legend
November 14, 2018

I don't do this much often, but I would go this way:

use PS to create a new sign, place new sign as PSD over old sign (if you are on the same frame then the still, it scaling and transform should fit), track old sign, put tracking data to zero, bind new sign to zero, or put tracking data to corner pin, if you can't to this with the zero.

Community Expert
November 14, 2018

Your replacement sign needs to be the same size as the composition frame for corner pin to work. Your workflow would work for motion tracking but not corner pin, the default workflow for Mocha.

Just create a new sign that is the same size as your comp and paste the corner pin data from Mocha into the sign.

For more help with Mocha please go to the Borris.FX website and look at tutorials that were prepared by professionals. There is nothing wrong with Mocha, you just didn't follow the right workflow.

Will..Author
Inspiring
November 14, 2018

What's causing the problem is the sign itself within the precomp layer not being the full size of the precomp layer (But AE Thinks it is because of the 1920x1080 frame it has from the original still frame I worked on) If I keep the extra stuff around the sign in PSD, the track will still work perfect, I'll just have the still frame stuff around the sign in the final composite, which is not good.


I'll try to explain it better:

I'm not really creating a 'new' sign in Photoshop, rather I'm using an exported still shot of the last frame of the video and then altering it to get a perfect looking 'new'sign. (I NEED to use a still frame because what I'm changing the sign to uses the original elements, just in a different order + painting out a couple things within the sign)

I've exported a still frame of the sign footage, and then in Photoshop painted out the sign and made my own (I used elements of the original to rebuild a changed new one). I need to delete the stuff around the sign because it's a still image. If I import it, without deleting everything around the sign, then apply tracking data, it'll be a still frame with everything around the sign tracking as well, which is not what I need as that will not be a very good composite lol. I can also leave the stuff without deleting, then just mask around the sign in AE, but the same result will happen because that's not the problem. The problem is that the cornerpin precomp replies on what's in the precomp to be full comp size, and the sign is not (Because I build it in Photoshop using a still frame of original footage.)

The footage I'm working with is moving, there is perspective change of a sign. I have it tracked perfectly and was able to complete the shot, it looks great and can be used as is, but it took a while to get to that stage because it was really messy to scale/stretch/cornerpin the psd sign layer within the precomp to fit up to 1920x1080 so it takes up the full precomp.

I'm just looking to see if there's a better way to do this.

I tried pasting transform tracking data, instead of corner pin and it did not work. I've also tried using null's instead and parenting the PSD to it, but it also didn't work.


The issue is that the layer I'm trying to composite is NOT the full size of the frame (But I wouldn't have been able to recreate the sign using parts of the original sign, unless I was using the original size of the sign in the original still frame). In Photoshop, I could stretch the image and crop the canvas so that it becomes fullscreen, then fit to comp in AE, but again, its messy to scale/stretch to get it to fill the frame size in Photoshop perfectly, it would be the same thing I did in AE, only I did it in Photoshop.

Is there a way to scale to comp an image within a frame where it ignores the alpha channel and only considers the actual sign and its corners?


Hopefully that makes more sense!

Thanks,

Mo Moolla
Legend
November 14, 2018

Why have u deleted everything around the sign to make an alpha channel. This empty area is causing the issues. What do you need an Alpha channel for if all you are replacing is the sign which has already been designed in PS?