For this Instructable, I used Photoshop Elements 5, which is Neanderthal for "digital image editor."
Step 1: Mask and Copy a Worm
Select your eraser tool and set the opacity at 5 to 10 percent. Gently "erase" the outline of the worm until the edges look translucent.
Step 2: Create the Different Animation Positions
You should have four layers: 1 background, and 3 worms.
Step 3: Add Animation Layers
Merge the background with the first worm, the second background with the second worm, and the third background with the third worm.
These are three positions of the worm, but since we are going to loop the animation (keep it going), we need another layer so the worm goes back and forth: 1-2-3-2-1-2-3-2-1 etc.
Copy layer 2 and place it above layer 3.
Step 4: Create Animation
In the File dropdown menu, select Save for Web.
At top right, check the Animate box. At the bottom, choose the speed at which you want the animation (I selected 0.5 seconds), and check the Loop box.
You may preview your animation by clicking on the icon of the world below the second image as seen in the illustration.
Hit OK to save your file as an animated GIF.