Try Tuts+ Premium, Get Cash Back!
Create Your Own Animated Pre-loader in Photoshop

Create Your Own Animated Pre-loader in Photoshop

Tutorial Details
  • Estimated completion time: 45 mins
  • Difficulty: Intermediate
  • Topic: Photoshop, .gif
  • Requirements: Photoshop CS3+ (Extended)

Final Product What You'll Be Creating

Let’s create an animated pre-loader gif for your next UI project. You’ll need the Extended version Photoshop CS3 or above.

We’re going to create a little animated gif that can be used for a multitude of widgets, anytime ajax content is being requested, files are being uploaded, whatever you fancy. Feel free to mix-in your own styles and variations to the loader as we go along. There are three major sections we’ll be undertaking:

  • Creating the Loader Shapes
  • Styling the Loader Shapes
  • Animating the Loader

Ready. Set. Go..


Step 1: Creating Shapes Setup File

Begin by setting up the canvas size, and add a quick background to get started.

  1. New Photoshop Document (File>New) || Control/Command + N
  2. Canvas size: 100px by 100px
  3. Double click BG layer, Convert to regular layer
  4. Set its color to dark gray, I used: #3d3d3d
Screen Shot 2012 09 04 At 12.42.55 PM

Step 2: Creating Shapes Background Pattern

Just for kicks, we’ll add a lined pattern to our background, and then start work on the loader.

Create a new transparent document: (7px by 7px). Draw a diagonal line with a 1px black pencil tool (click the top left pixel, hold down shift and click the bottom right pixel)

Screen Shot 2012 09 04 At 12.43.00 PM

Define and name the pattern (Edit menu > Define Pattern).

That done, jump back to the original document and create a layer style of “Pattern Overlay” on our gray background layer: (Layer menu > Layer Style > Pattern Overlay). Choose your pattern from the pattern box, and lower the opacity (I used 20%).

Screen Shot 2012 09 04 At 12.45.21 PM

Step 3: Creating Shapes Guides

We’re going to set up a few marks which will act as guides to help us along – we’ll use the “Transform Again” Command to speed things up.

Draw a 1px vertical white line with the line tool on your document:

Screen Shot 2012 09 04 At 6.04.26 PM

To make sure it’s aligned in the center, select both its layer and the background layer, grab the move tool, and click the “Align Horizontal Centers” option like so:

Screen Shot 2012 09 04 At 12.47.15 PM
Screen Shot 2012 09 04 At 12.47.10 PM

Rotate the line 45° (Select the line Edit menu> Free Transform || Control/Command + T)

Screen Shot 2012 09 04 At 12.47.35 PM

Select Edit menu > Transform > “Transform Again” while holding down the “Option/Alt” Key (Command/Control + Option/Alt + Shift + T )

Perform that command several times until the line has rotated all the way around, like so:

Screen Shot 2012 09 04 At 12.48.16 PM

Step 4: Creating Shapes Tick Marks

Using the same technique as explained above, we’re going to add some little tick marks on each grid line to make the loader go round and round.. Here goes.

Add some guides around where you want your initial “Tick Mark” to appear (make sure your guides are on whole pixels, don’t split pixels).

Screen Shot 2012 09 04 At 12.54.38 PM

Create a rounded rectangle with a 1px radius within our guide lines (make sure you have snapping turned on for guides: View menu > Snap)

Screen Shot 2012 09 04 At 12.53.50 PM

Using the Direct Selection Tool move the bottom corners (nodes) of our rectangle tick shape inwards, so the shape tapers.

Screen Shot 2012 09 04 At 12.59.00 PM

Utilize the same ‘Transform Again’ trick we used above, to duplicate the shape all the way around our tick marks (When rotating the 45° be sure to set the transformation point to the center of our grid, not the center of the rectangle tick shape, which it where it defaults).

Screen Shot 2012 09 04 At 1.00.32 PM

Select Edit menu > Transform > “Transform Again” while holding down the “Option/Alt” Key (Command/Control + Option/Alt + Shift + T ) until the tick has been copied all the way around. It should look like this:

Screen Shot 2012 09 04 At 1.01.24 PM

Layer Check: ensure your layers panel looks like this:

Screen Shot 2012 09 04 At 1.01.10 PM

Step 1: Styling Shapes Build Our Tick Marks

Phew. We’ve got the pre loader shapes all created, now we’re just going to add a bunch of layer styles to spruce things up a bit. As usual, salt to taste. We’re going to be adding layer styles which can all be found in “Layer menu > Layer Styles”.

Add a “Color Overlay” layer style to the ticks layer (I used #242424).

Screen Shot 2012 09 04 At 1.03.39 PM

Add a “Drop Shadow” layer style to the ticks layer:

Screen Shot 2012 09 04 At 1.04.07 PM

Add a “Inner Shadow” layer style to the ticks layer:

Screen Shot 2012 09 04 At 1.05.48 PM

Your loader should now look like this:

Screen Shot 2012 09 04 At 6.50.18 PM

Step 2: Styling Shapes Duplicating Layers

There are a few ways we could go about this next bit, but to make things simpler we’re going to duplicate our tick layer five times, and then delete all of the shape ticks which don’t belong to those particular shape layers. We don’t want any overlapping ticks marks from layers below, as the layer styles we’ll be adding would stack, causing over-exposed looking effects.

Duplicate your base tick layer four times, then start deleting tick marks on each of the layers until you end up with the following:

Screen Shot 2012 09 04 At 1.17.51 PM

You can use the Direct Selection tool to delete the tick shapes from each of the layers.


Step 3: Styling Shapes Style Them Puppies

Now we’ll add some styles to each of the individual tick mark layers we separated out. I’ll be referencing my own layer names.

To the layer named “Shine-Active”, add/modify the “Outer Glow” layer style:

Screen Shot 2012 09 04 At 1.20.49 PM

To the same layer, add/modify the “Inner Glow” layer style:

Screen Shot 2012 09 04 At 1.20.56 PM

Then add/modify the “Color Overlay” layer style (I used #0087c6):

Screen Shot 2012 09 04 At 1.20.59 PM

To the layer named “Shine-Fading1″, add the exact same styles above, omitting the “Outter Glow” layer style:

Screen Shot 2012 09 04 At 1.21.32 PM

To the layer named “Shine-Fading2″, add/modify the “Inner Shadow” layer style:

Screen Shot 2012 09 04 At 1.22.18 PM

To the same layer, add/modify the “Inner Shadow” layer style (I used #0087c6).

Then, to the layer named “Shine-Fading3″, add/modify the “Inner Shadow” layer style (note the change in opacity as well):

Screen Shot 2012 09 04 At 1.22.37 PM

Your loader should now look something like this (tweak layer styles to your liking):

Screen Shot 2012 09 04 At 1.22.54 PM

Step 1: Animating Shapes Group & Duplicate

Okay, we’ve got the base styles set up, now it’s time to duplicate the layers a whole bunch (which will make animating a snap) and create our animate .gif

Group all of the layers that make up our tick mark (highlight them all + Layer menu > Group Layers)

Screen Shot 2012 09 04 At 1.23.28 PM

Duplicate the entire group, then rotate it 45° (Edit menu > Free Transform). Repeat Step 2 until you’ve rotated the tick mark all the way around (you’ll have eight groups in total).

Screen Shot 2012 09 04 At 1.25.53 PM

Your loader should look something like this:

Screen Shot 2012 09 04 At 1.26.02 PM

Step 2: Animating Shapes Animate

Alright, our layers are all set up, and we’re ready to animate. We’re going to stick with regular frame by frame animation, although we could accomplish the same things with the timeline-based animation.

Open up the Animation Panel: (Window > Animation). Turn off all the tick group layers except the first one, then click the “Duplicate Selected Frames” button in the animation panel.

Screen Shot 2012 09 04 At 1.26.42 PM

Turn off the first grouped layer, and turn on the second grouped layer.

Screen Shot 2012 09 04 At 1.26.47 PM

Repeat the previous step for each of the group layers. Highlight all frames in your animation layer (Shift + Click Each Frame) and set frame duration to .1 sec

Screen Shot 2012 09 04 At 1.27.38 PM

Choose File > Save for Web & Devices and use the following settings for your animated .gif

Screen Shot 2012 09 04 At 1.28.19 PM

Open up your .gif in a web browser and admire your new fancy loader! Lastly, get some ice cream.


Conclusion

That’s it. I hope you’ve enjoyed creating the loader! It was fun for me to set up. Upload and link to some of your creations in the comments, and ask any questions you may have.


Additional Resources

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.robertbrodziak.com/ Robert | RB dsgn

    Beautiful. Small details like this can make website truly unique and original. I guess that’s a good time to customize my preloader;)

  • samir

    good tuts

  • Preston

    Pretty useful. I have found that most of the free web services to created animated loader gifs do a pretty terrible job of implementing transparency so that if you want to use the gif on a variety of backgrounds, it will look like crap.

    • http://studentwebhosting.com Andrew Wilson

      Hey Preston,

      I agree. Although I think the problem with transparency lies in the fact that animated gifs are 8bit images, and only allow for on or off transparency. So any transparent pixels would have to be matted with your website/backgrounds color else it would be very “blocky”… I’d say it’s more of a technical limitation.

  • http://www.jongarciadesign.com Jon

    Great tutorial, particularly in the animated gif tips (kind of new to that myself).

    But I ran into a problem early on that I had to work around. I could not move the transform reference point on the tick mark to the center of the file to do the transform trick in Step 4. Seems that my Photoshop CS5.5 wouldn’t allow me to do that on any object that was smaller than 30×30 pixels. Just created the tick pattern in Illustrator instead and then picked back up but if anyone knows why that transform restriction happened, please let me know.

  • Marc

    Does anyone know of a good tutorial on how to implement a pre-loader?

    • Andrei Barsan

      Do you mean a flash or a javascript preloader? I’m guessing you’re referring to one of the two.

  • http://blogverize.blogspot.com Nimsrules

    Sleek, usable and stylish all the same time. Gonna work on this ASAP. Thanks for this tutorial.

  • alex

    Thank you so much for this tutorial it was great! was having a little bit of trouble doing the rotate and copy but it all worked after a few tries. :)

  • http://www.maiconweb.com Maicon Sobczak

    I didn’t know this was possible! Great article. I’ll try make my own preloaders.

  • http://www.nuvochop.com NuvoChop

    Wow, that is somehow amazing. Thank you. It actually worked for me aswell!

  • http://zerp.ly/Karlen Karlen

    This is a great and modern pre-loader tutorial. I’ll try to work on it very soon. BTW. Andrew, can you suggest me the sources from which I can learn photo manipulation technique (I do not want tutorials that show me how to use Photoshop tools to do something, I want to know what I have to do for creating a very good image manipulation with DETAILS, for example lights, shadows, etc)? I’ll appreciate any response.

  • Ilma

    Great tut! But it’s easier done in Fireworks

  • TMS

    How to create multiple lined shape in one layer?

  • http://www.derby-webdesign.co.uk Derby Web Design

    Great tut. Pixel perfect loading gif :) I’ll give it a try.

  • Braden

    This is a pretty good tutorial definitely intermediate, but i think it might be taken from muleymadness.com

  • Joy

    Awesome tutorial thanks for share it.

  • Guest

    xi xi

  • Brymka

    Great tut!!! Is there a way that this can be done in Adobe illustrator? If someone knows,it would be wonderful if they share. :)

  • Mina

    great Tut!! help me very much!!! Thanks!!

  • James

    Nice one. But I really think it’s much more simple to use something like http://preloaders.net . It takes much less time

    • icrawler

      Read the title again. It says “Create your own”, not “Create an animated preloader using other websites”.

  • nikunj

    thanks.. help a lot..