- 1 Kdenlive. Rotoscopy effect
- 2 Some practical examples of using the Rotoscopy effect with titles in Kdenlive.
In this post we will see some aspects of the use of the Rotoscopy effect with texts in Kdenlive.
Kdenlive. Rotoscopy effect
The applications of this effect are very diverse. We have already seen in this series of tutorials some aspects of its use. In one entry it was used to trace a circular route on a map and in another article to make a very precise mask of concealment and even with different shapes that can change over time.
We have already seen that it is a very powerful effect with which you can do many more things than what we have seen and we will see in this tutorial being fully animatable but requiring a bit of practice and knowing well both the effect and its way of working to take advantage of it .
The “Rotoscopy” effect is found in the “Alpha Channel Manipulation” family of effects.
Its handling is very simple:
- We insert it in the video clip, image or title to which we want to apply it.
- We made sure to have the edit mode button activated in the project monitor to be able to draw the mask of the rotoscopy effect directly on the monitor.
- We draw the desired mask with the necessary points. It is important to think carefully about the insertion of these points since once the mask is closed, points cannot be added or removed. To close the mask once the last point has been inserted, press the right mouse button and a straight line will be drawn between this last point and the first.
- Just when we close the mask, the first keyframe is created for us.
- If we do not animate this mask we will be able to modify its shape from the inserted points and it will remain static. These values will be added to the single keyframe.
- If we want to animate this mask, we will have to insert new keyframes and modify the mask to our liking.
- These points have Bézier shooters, widely used in vector graphics, so we can curve the lines between points. Each point has a Bézier handle on each side.If we move these Bézier points the straight lines between points are curved.In the image above I have only moved the Bézier points from the rectangle that I show with the points outlined in red.
- The best of Bezier points, they can be animated by inserting keys and modifying their position.
In this animation the only points that I have moved from the initial rectangle have been the Bézier points. For this animation I have used 10 frames, but it is slowed down so that it looks good how we can change a shape just by modifying the mentioned points.
Then the animation in real time in a clip of one second in length; I remember that the animation lasts 10 frames.
Some practical examples of using the Rotoscopy effect with titles in Kdenlive.
Practice 1. Phrase of a line that appears and disappears through the Rotoscopy effect
With a one line text it is very simple.
- We insert the effect to the title clip.
- We draw a mask of four points making the text a frame
- Now we put the value of “Operation alpha” in “Subtract”And we get this result, a total transparency in the box that frames the four-point mask
- We now proceed to animate her. We create a frame key in the temporary value that we want the text to appear late and, in this key, we move the two points from the left to the right until the entire phrase is visible.
Detail of how the mask is in the key in which the phrase has been discovered. The text has a semi-transparent black background so that it is easy to read without the white color of the text blurring with the light colors of the background image. In the following image I have removed this background to show the importance of putting this element to give clarity to the text. In fact, it is a very common mistake not to put it and this sometimes makes reading difficult.
- I have done a one second text input. Now I’m going to make a one-second output also on this same clip and in the same direction it entered. Let’s see this process in parts:
- We create a key one second minus one frame from the end. This clip is 4 ′ 24 frames long so I insert the key in the second 3 ′ 23 frames.
- I advance one frame (3 ′ 24) and insert a new key, and in this, I move the mask the 4 points to the left of the phrase. What I have done is move the mask in a frame.
- Now we insert a key at the end of the clip and stretch the two points to the right of the mask until they cover the phrase.
Below is a gif with the result of this practice with a black background and in real time, 5 seconds. With a three-second introduction.If the time of the process of making the phrase appear slower, the result is very similar to that obtained with the effects that emulate real-time writing.
Practice 2. Sentence of several lines that appear sequentially in reading order
The objective is to make a brief sentence of three lines (if it is understood with three we can make the ones we want) that will appear sequentially by letters line by line.
These lines will appear in one second each, they will remain for another second and will hide in the same direction that they have appeared for one second each, so the time will be 3 + 1 + 3 = 7 seconds.
We will do this process with two clips, one of 4 seconds that will appear plus the second static one and an exact copy of this 4-second clip that will be cut to 3 seconds + one frame and in a very simple way it will allow us to make the exit … Well let’s see the detailed process since it is a bit laborious. to understand how we will do this in the way that seemed easiest to me and see why this extra frame is mentioned.
We start from the base that we have the initial title clip, of 4 seconds, inserted in the timeline, with the settings we see in the following image:
the text I’m going to use is the following:
And now that we have the script and elements to create the animation, let’s get to it.
- We insert the “Rotoscopy” effect to the title clip.
- Then we draw the mask as follows;
* As an advice, I would like to say that if a point is not exactly where we want, not to try to correct it until the mask is closed and if the mask becomes complicated and does not come out as we wish, it is best to eliminate the effect and start over.
- We put the effect in “Alpha” Mode and the value of the Alpha Operator in “Subtract” and the text will disappear.
- Now we move to one second from the start of the clip and insert a key into the rotoscopy effect and move points 1 and 2 to the right.* After inserting the second keyframe, we can only edit the mask when the cursor is over one of the keys or inserting new ones.
- We move to second 2 of the clip, insert a new key and this time we move points 4 and 5 as well as 1 and 2, until we completely discover the line.
- We move to the second 3 of the clip, we insert a key and this time we move points 7 and 8.
We already have the input animation finished, now we need to make the output animation.
- We head to the timeline and copy the title clip that we just animated. Right click on the clip or “Ctrl + C” with it selected.
- We press the right button of the mouse in the empty space after the clip that we have just animated and choose paste or press “Ctrl + V”. Surely it will not be perfectly adjusted but we drag it to adjust it with the previous one if there are no empty spaces between them.
- Now we have a clone of the input clip and in a very simple way we will make the output one, but first we will eliminate the second one that is left from this clip; for them we place ourselves in the third key and once here we advance a frameWe press “Shift + R” to divide the clip and delete the final part.
- At this point, we still have the same animation as the input clip, so to output the text, all we have to do is set the Alpha Operation to “Minimum” in effect.And that’s it, just with this adjustment the text becomes visible in the first key of this second clip and disappears through the animation of the mask that we have already made in the first clip.
I am attaching a gif below of how the mask looks throughout the animation, the gif is slowed down to make the process look good.
Here is a real-time gif of this practice:
Observations: It can be said that this animation is fast, the objective was to show how this effect was made, but speed is a matter for each project; generically, the duration of one second (more or less) every two words can be calculated as an average speed reference, so in this case it would take three seconds for each line to be discovered. I put a gif below of what this animation would look like with 3 seconds per line; I’m just going to make the input, since the output can be fast or the same, but we already know how to do it.
With this speed it seems that we emulate the typewriter effect, although to do this effect 3 frames per word, spaces included, are calculated for fast writing and 5 frames per word for slow writing. With these calculations we see that the first line has 30 characters counting the spaces, so a slow writing would take 6 seconds and a fast one would take 3 seconds + 15 frames.
Practice 3. Text that changes color in sequence, like karaoke
In this practice we will emulate the effect of a text that will be black at the beginning and gradually colored.
For this effect to be functional on a video or image we will need two title clips, one for the background and the other with the text.
In the title clip that carries the text, it must be the color that we want it to transform from black or to change from this color to black, as we want.
Below I put an example image of the composition for this effect in which we have a video or background image, a text clip that serves as the background for the text (in this example, it is semi-transparent orange) and a title clip with the text (in this case light green).
Well let’s get to it, we start from the base that we have the clips in the timeline with the necessary durations.
- We insert the rotoscopy effect to the title clip with the text and draw the rectangle that will encompass the text.
- Now we have to adjust the parameters of the effect to make the text turn black to turn green. What we do is simply set the Mode to “RGB” (this term means RGB, Red (Red), Green (Green), Blue (Blue)) and we activate the “Invert” box, leaving the effect as seen in the following picture.
- We insert a key in the second 3 which is how long we want this process to last and we move the two points from the left of the mask to the right.
Gif that emulates the result of this animation, I have removed the background video leaving this black so that the gif is lighter.
Practice 4. Mascará for a circular text
Now we will do a practice that is similar to what was done to draw a circular line on a map.
The text I’m going to use is the following in the layout you see below.
The animation will last 4 seconds, one per side of the square. We start from the base that we already have the title clip inserted in the timeline.
- We insert the Rotoscopy effect and draw the mask as indicated in the following image.
- We set in effect in alpha mode and the alpha operation in subtract.
- We insert the second key (the first is inserted automatically when closing the mask) one second from the start of the clip and move points 1 and 10 illustrated in the previous image as shown belowI also had to retouch the Bézier handles to make a correct fit.
- We insert the third keyframe in the second 2 and adjust the mask as we see below, making the necessary corrections also in the Bézier handles.The points accumulate as we shrink the mask.
- We continue with the insertion of the next key in the second 3 and we move the mask as follows.As can be seen in the image, the points are placed so that the phrase is discovered in the correct way.
- And now only the final stretch is missing; we insert the keyframe in second 4 and adjust the mask.
- CORRECTIONS: At this point, we check to see if the mask does its job correctly.
- DEPARTURE AT THE SAME ADDRESS THAT YOU ENTERED: To make the output we do exactly what we have done in practice 2.
- We copy this clip and paste it below, taking care to eliminate the white space between the two clips
- We cut out what is left over after the last key. Remember to advance one more frame of this last key.
- And we set the Alpha Operation value to Minimum.
And we already have the practice done. I am attaching a gif with the result.
In this post we have only worked with texts, but this effect can also be used for text backgrounds (both in clips where text and background go together and in separate clips).
The possibilities of this effect are very extensive in all editing fields.
Download the kdenlive files of the practices carried out.