What kinds of NUKE tips do you need? Join the Steve Wright's NUKE NUGGETS group on LinkedIn, and post your requests there.
Skill Level Intermediate
- [Narrator] Hi this is Steve Wright, welcoming you to this week's Nuke Nugget, Fast and Accurate Image Lineup. We have many occasions to line up two images for compositing or painting. So here, we'll look at some techniques that will speed up the process. First we'll look at a methodical work flow for the line up operation itself, then a couple of display techniques to make it easier to see that the images are properly aligned. So let's take a look at these two images here. I want to line these up. This is my crooked one. I want to line it up to the straight one.
So if we just open up the transform node, and let's hook up to our dissolve node, so we can see what we're doing here. This dissolve is set for a .5 dissolve between the two images. And let's say I just start moving things around. I want to line this up. Let's say I want to fix my rotation here. So let's get that rotation corrected first. That kind of makes sense. Looks like I've got a scale in X and Y to deal with here, so let's bring that in. Well, now I got to move my left and right because I moved the scale.
So you see, you start iterating back and forth. Move the scale, move the translate, move the scale, move the translate, touch up the rotate. So to avoid the iterations let's do a methodical procedure. Okay, we start with the image we're going to move, selecting a common point, the match point between the two images, between this one and that one. So let's choose this lower left hand corner right here. So that's going to be our common point between the two images.
So, we start by setting the pivot point right on top of that common point, push in a little bit. Make sure that's nice and tight. Okay, now we go to our dissolve node, and we say all right, I'll just move these two till they're right on top of each other here. Okay, and the other vertically. Okay, so let's see if we like that. Okay, next I'll set up the rotation.
So, let's dial in some rotation here. Okay, and because the rotation is around the pivot point, it did not disturb the registration of my common point. Okay, so now we'll go to the scale. Let's start with a scale in the width. Okay, so we'll just bring that down, there we go, and in the height, we'll bring that down to there. Oh, let's back up a little bit, and done. You see, none of the iteration back and forth.
That's the whole idea of using this line up work flow. Okay, now let's look at a couple of different ways for seeing the registration between the two images a little more clearly. So, if we start here with a standard cross dissolve, let me clear my property bin here. I don't know about you but I can find this hard to resolve and a little confusing, so let me bring my transform node up here, and I'm going to, again the same drill.
I'm going to choose my common point between these two images. Okay, and I'm going to make the tip of the roof my common point. So we'll start by setting our pivot point right here on the peak of that roof, there we go. So if we go back to look at the merge node which shows the dissolve, and then I can start lining things up here, and maybe a little bit of Y there.
We'll kind of push in a little bit. Okay, there, and then maybe some more wideness here. Okay, then we'll come down to the bottom. There's my rotation, so let me try and get that locked in. Okay, well that looks pretty good. But let's see how accurate that is. So if I go to my transform node, and the target image, and I bounce between the two, well, see, there's just a little bit of offset there, okay.
So, a method that I've developed that you might find helpful is instead of trying to line up the two images we create an edge detection version, and then we line up the edges. More importantly, they're colored. Okay, so here we go. We'll start with the image we want to match. What I do here is I do an edge detect. So we look in the alpha channel, there's the edge detect. Then we take a shuffle node and shuffle the alpha channel into the green channel, and I've blacked the other channels.
So what I get is, if I enable this guy, switch the viewer to him, I get a green edge detect version of the image that I want to move. Same drill for the background for the target image. We'll do an edge detect here, and a shuffle there, but this time I put the alpha channel into the red channel. So the idea is I have a green outline for this guy, and a red outline for that guy.
Now the reason I chose green and red is it's a mnemonic. You know, green is go, and red is stop. Okay, so I want the green to go to the red. Now I used a merge node. I set for a 50% merge on the mix right here, okay. The dissolve node darkens the images down, 'cause it's scaling the RGB values down and then adding them together. The merge node set to mix does not scale them. So I'm seeing 100% of my colors. All right so, I've already got this basically lined up with the transform.
So now with my red and green, you see, the nice thing about this is if I'm off target I can say, ah, green is off to the left, so I need to move green to the right. So I get that here and go chug, chug, chug, chug, chug, okay, and maybe just a little bit more, okay, there we go. And then vertically again, if I am seeing green vertically, that means I want to move that guy down a little bit.
So let's try doing this, and that looks good right there. Let's go down to the bottom and check my rotation. No, no, I can see green. So I don't want to see green, okay. All right, so maybe I'll like that. Okay, now let's see how we did. So I'll turn off these guys here so I can compare my repositioned image to the target image, and there we go.
That looks much better. In fact let's go full screen, and toggle between the two, and they're very nicely lined up. Okay, so the edge detect method, again, just so you can see better. Now here's another method that you might like, the offset mask method. That's where we do this number here. This is very precise. Now, what we're going to do is a paint through, a reveal paint.
Now, the roto paint node itself has the onion skin feature, but that's just another cross dissolve. So, this goes one step further. Give us even more visibility. So again, we'll use the same work flow now. We'll start with the transform node on our original image. Set our common point. We'll look at a point up to where we're going to make our common point, here. All right, let's say we like that, okay. Then the way this is set up is you take one of the images and you invert it and then you put that through a dissolve operation with the other image.
So this set up gets you this embossed effect, and the key is when the two images are perfectly lined up, all the embossing goes away. So let's try this, and I'm going to move my guys here, and move that there, and for the Y we'll take it down here. I'll see where with the Y upped up there.
Something like that. Okay, see, I made the lines disappear. When they disappear, that means they're right on top of each other. Okay, so now for rotate we'll go down to the bottom here, and we'll check our rotate. Oops, too far. So let me back up a little bit. Okay, everything disappeared. Now there's still a residual effect. Let me show you another trick. You can improve your visibility in here by adjusting the viewer to increase the contrast.
So watch this. I'm going to gamma down the viewer, and then gain it up, and now my embossing is more obvious. I can see better, okay. So that's a way to look deeper into the images. Now I've still got a little bit of residual here, so let's, let's talk about what that's about. I'm going to switch my viewer to the transform node of the match one and then there's the target. We'll go to full view here, full resolution.
And as I toggle between the two, you see they're lined up quite nicely, but let's push in. What's going on is we're seeing the filtering differences. The image that moved is being filtered. It's not as sharp as the original, and that's that residual we're seeing here in the emboss right there, okay. So, the idea is because of the filtering in the transformations we can't get a perfect, unless it's just integer pixel translations, then it would be perfect, or perfectly flat, for you.
But we get it to the minimum point, okay. So if I move in left and right, that gets worse in either direction. So put that back. If I move vertically, that gets worse in either direction. We'll put that back. Okay, so I'm convinced I've got the optimal line up there. Now we'll switch to the roto paint node, open him up in the property panel. Let's go get a reveal brush. Hook my viewer up to the roto paint node, and paint through, paint through, and paint through.
Done, perfect match. So there you have it. Faster, and more accurate image line up procedures. Be sure to check in next week so you don't miss out on my next Nuke Nugget.