Glitch effects are still popular these days and appear in many variations. Using the animation feature in Photoshop, we are going to turn a simple image into a short movie.
In this tutorial, I will teach you how to lift an object from its background using the automated Content Aware Fill and the good old copy and paste technique. Finally, we will add subtle animation into the scene.
To follow this tutorial, we are going to use this resource:
1. How to Lift an Object From Its Background
Let's start by analyzing the image. We have a bus and two trucks in the scene. Before we can animate them, we need to lift them from their background. We can do it using the old way, i.e. manual Clone Stamp Tool, or using the automated Content Aware Fill feature. For better results, I suggest you use the biggest image resolution available. With a larger image, you can see all the detail and make the cloning process easier.
First, we are going to cut the furthest truck from the background. Duplicate the background by pressing Control-J. Make a selection around the truck using the Lasso Tool. Click Edit > Fill. Select Contents: Content-Aware.
Click OK to let Photoshop automatically fill the selection with suitable pixels. Photoshop did a nice job, but not perfect. If you look closer, there are some flaws that we have to fix.
We'll continue using a simple copy and paste technique. Copy (Control-C) a part of the road, and paste (Control-V) it on top of the previous road segment made by the Content-Aware Fill. You may need to rotate and transform its shape. You can also bend the new road shape to match the road perspective by right clicking inside the transformation bounding box and selecting Warp.
Add a layer mask into the new road segment. Activate the Brush Tool with low Hardness (0%) and set the foreground color to black.
Paint the edge of the road until it fades into the background.
We also need to add road markings to keep it identical to the other road segment. Select the road marking and copy it using the shortcut Control-Shift-C. Paste it (Control-V) on the desired area. You can use a warp transformation to bend the road marking shape. Pull one of the boxes to change the direction of the road marking.
Add a mask into the layer and then paint its edge with black using a soft Brush Tool until it fades naturally into the background.
Next, we need to reveal the truck again. We can simply copy the truck from the original background onto a new layer and place it on top.
Add a layer mask and paint its edge with black until the truck fades into the background.
Let's continue with the second truck. Start by making a path around the truck. Hit Control-Enter to convert the path into a selection. Hit Control-J to duplicate it as a new layer.
Next, we need to cover the truck. Select part of the road segment and copy it. You can directly copy the content of the selection using the shortcut Control-Shift-C. If you want to use regular Control-C, you will need to activate the corresponding layer first.
Move it until the truck is covered. Obviously, you will need to use the Stamp Tool to remove the electricity pole.
Load the previous selection covering the truck and save it as a layer mask. As you can see, we still need to fix its edge.
Add another copy of the road segment and delete its edge using a soft Brush Tool.
Make a new layer. Use the Brush Tool to draw a thin line for the electricity cable. For its color, sample the available cable by Alt-clicking it while the Brush Tool is active.
Copy the truck and paste it between the cable and the road.
We are going to move the truck through the street above it. So select the street and copy it to a new layer (Control-C and then Control-V).
The road segment should be placed above the truck so that when it moves, it is hidden by the road. For now, place the truck in its original place.
Next, we'll work on the bus. Duplicate the background and select the bus manually using the Lasso Tool. We'll try to remove the bus automatically using the Content-Aware Fill feature. Click Edit > Fill and select Contents: Content-Aware. Click OK.
In this case, Content Aware Fill isn't good enough. You will need to polish the result.
Depending on your situation, you may want to try manual cloning. Here, I select some parts of the road behind the bus and then copy (Control-Shift-C). Then, paste the road segment on top of the bus. Hit Control-T and then rotate it until it matches the road perspective. Right click and select Warp for a more advanced transformation. Pull the corresponding boxes until the new road aligns nicely to the original one.
Add a layer mask and paint its edge with black until the new road blends seamlessly into the original road.
Try to remove any similarity to the original clone source by making it overlap with another part of the image.
Reveal the original bus image again by duplicating it onto a new layer. Place it on top of the new road.
2. How to Animate an Object and Add a Glitch
Let's move on to prepare the glitch animation. We don't want to have a huge-sized GIF animation. It's just not effective. We need to scale down its size. Click Image > Image Size. In the next dialog box, make sure the Resample checkbox is activated. Set the image width to 800 pixels. Click the OK button.
Our glitch animation will be very short, only half a second. For this, we only need 5 or at most 6 frames, with each frame lasting for 0.1 second. Duplicate the bus layer five times and keep them in a separate group layer.
Activate one of the bus layers and apply a Wave filter. Click Filter > Distort > Wave. In this tutorial, we set a short Wavelength with minimum Vertical Scale: 1%.
Move on to the next bus layer. Apply the same Wave filter. Hit Control-Alt-F. To differentiate the result, hit Randomize. You can also change some of the available settings if needed.
Keep on adding this to the other buses on different layers.
Repeat the same steps on the furthest truck. Duplicate it five times and then apply the Wave filter, but this time with lower settings to keep its result subtle.
We are now ready to start animating the scene. Open up the Timeline panel. Click Create Frame Animation. We will make the animation frame by frame.
For the first frame, return the scene to its original position. Every truck and bus should be stationary in its place. Set the frame duration to 1 second.
Click the New Frame button in the lower part of the panel to add the next frame. In this frame, make sure that the layer which has the truck going under the street is active. Hit the Down Arrow and then the Left Arrow button once to move its position one pixel down and one pixel left. Set its duration to 0.1 second.
Make another frame. Again, move the truck one pixel down and one pixel left. As in the last frame, set its frame duration to 0.1 second.
You already know the drill. Add a new frame and then move the truck one pixel down and one pixel left. Keep on doing this until the truck is hidden out of sight, covered by the street. To see the result, click the Plays animation button. Below, you can see the animation.
Let's move on to the bus animation. Add another frame. Hide the original bus layer and reveal one of the layers that contains the bus altered with the wave filter. Set its duration to 0.1 second.
Add another frame. Hide the previous layer and reveal another layer that contains the bus altered with the wave layer. The duration should be 0.1 second.
Another new frame and another layer. Go on, you know the drill.
After half a second, put back the original bus.
Set its frame duration to 2.0 seconds. This will add another "silence" into the scene. Below, you can see the animation we have so far.
Add another frame. This time, we're going to animate the furthest truck. Hide the original truck and reveal the one that has been altered with the Wave filter. Set the frame duration to 0.1 second.
Add another frame. Hide the last layer that contains the altered truck and reveal the next. Continue doing this until we have half a second animation of the truck glitching.
3. How to Export an Animation as a GIF File or Video
Our final step is exporting the animation. You can use the Save for Web command to save the animation as a GIF file. Make sure you have selected Looping Options: Forever to keep the animation running.
To save file size, try to decrease the number of colors used in the final file. By decreasing the number of colors, you may risk losing contrast, brightness, and so on. So keep experimenting to get a sensible proportion between file size and image quality.
You can also export the animation directly from Photoshop as a video by clicking File > Export > Render Video.
Awesome Work, You're Done!
As you can see in this tutorial, we can get unlimited variations of glitch effects by combining them using different types of distortion. Check out other Envato Tuts+ tutorials on glitch effects for more inspiration.
If you follow this tutorial, don't forget to share your final result in the comment section below. I'd love to see it.