Thursday, October 30, 2008

Fire in Photoshop - seamless animated loop

I needed, at some point, a “fire animation” that would be:

1. looping seamlessly

2. horizontally tile-able


I googled and I googled, in vain - I couldn’t find anything but a small tutorial about blending modes. So I took on doing it myself and with some Photoshop scribbling, I got what I wanted - something like this:




How can you too do something like this? Perty simple, just follow the steps in my tutorial:



Part One: The Flames


1. Open Photoshop



2. Create a new file: File > New…

fire_01.gif


3. In the Tools Paletter, set the Foreground to WHITE and the Background to BLACK:

fire_02.gif


4. In the Layers Palete dublu-click the Background layer

fire_03.gif


… a new window will open:

fire_04.gif

give a new name to the layer, then press OK (this will unlock our layer, which is going to help us later)


5. With the new layer selected, go to the main menu and choose: Filter > Render > Clouds. This will fill our canvas with something like this:

fire_05.gif


6. Duplicate our layer (right-click it > Duplicate Layer… > in the new window give it another name - I chose “background fix” this time)



7. With the new layer selected, press CTRL + F (this will repeat the Clouds effect used earlier, since we’re going to need 2 different patterns to add realism to the flames). The layers palette will now look something like this:

fire_06.gif


Next there’s a series of steps that we’re going to repeat for each of the 2 layers, with the purpose of making them seamlessly tile-able. I’m going to explain these steps for the “background mobil” layer first, but you’re going to repeat them for the “background fix” layer too, afterwards


8-1. Hide the other layer, by pressing the “eye” icon in the left, to see what going beneath it:

fire_07.gif


8-2. Duplicate the “background mobil” layer (you should already know how, by now)


8-3. Shift the new layer to the right, sso that the two would stick precisely at the right edge of the canvas (if you press the “Shift” key while dragging, you’ll make sure that the move will be limited to the horisontal/vertical - we’re interested in the horisontal - to ensure a proper alignment of the layers):


fire_08.gif


8-4. Shift together the two layers to the lef, so that the stitch line would reach about the middle of the canvas:

fire_09.gif


8-5. Once the stitched perfectly aligned, merge the two layers into a new one, selecting thwm with “Shift” and then pressing CTRL+E


8-6. Now you KNOW for sure that whatever starts on the left continues on the right. But we still have that nasty-looking stitch line To make it dissapear, I suggest you use the “Stamp” tool,

fire_10.gif

with proper brush sizes, chosen to achieve an unnoticeable, smooth stitching at the half of the canvas (I’ll just assume you DO know how to use this tool)


9. Repeat the steps 8-1 through 8-6, only this time for the “background fix” layer (this, ofcourse, after re-making it visible)



10. Select again the “background mobil” layer and create above it 3 new layers, by pressing the “create new layer” button:

fire_11.gif


Let’s take care now of these 3 new layers (before anything, though, hide again the “background fix” layer so you can see what’s going on beneath it):


11-1. Fill Layer 1 with White (Edit > Fill… )

fire_12.gif


11-2. Right-click Layer 1 > Blending Options:


fire_13.gif

Press OK


11-3. In the Layers palette, set the Fill parameter for Layer 1 to 0 (zero)

fire_14.gif


Note: We created here a gradient that will define later what’s dark and what’s visible flame. You can always use the brush and define other shapes, for instance an isolated flame, if you wish. It’s all up to your immagination.


12-1 Fill Layer 2 with the HEX color ffa800 (R:255; G:168; B:0):

fire_15.gif


12-2. Set the “Blending Mode” for Layer 2 to “Color Dodge”:


fire_16.gif


13-1. Like in step 12-1, fill Layer 3 with the HEX color ff7e00 (R:255; G:126; B:0)


13-2. Like in step 12-2, set the “Blending Mode” for Layer 3 to “Color”


14-1. We’re getting again to layer “background fix”. First of all, right-click it and choose “Blending Mode…”, and in the open window go to “color overlay”, set “Blend Mode” to “Darken” and the color to a pure yellow (HEX ffff00 (R:255; G:255; B:0))

fire_17.gif


14-2. Like in step 12-2, set the “Blending Mode” for the layer to “Color Burn”

Goood, we’re now through with the first (static) part of the tutorial. If you followed through correctly you should now have something like this:

fire_18.gif


If you want to see it animated, shift a bit the “background mobil” layer up and down, and you’ll see the flames catch life. With a CTRL+Z put the layer back - we still have work to do with it.


Part Two - The Animation


To create the feeling of a rising flame, we’re going to have to move the “background mobil” layer upwards, on an exactly 2-canvases distance, in order to get a complete loop. For this, we’re going to have to repeat, with some differences, the steps 8-1 - 8-6, only this time on the vertical:


15. Start by hiding all the other layers:

fire_19.gif


16. Duplicate our layer and move it upwards, (always keeping the “Shift” key pressed, for alignment), exactly to the point where the stitching line between these two layers would be on the top margin of the canvas.


17. Select the 2 layers and bring them down together, with the stitching line at about the half of the canvas, to make sure they’re perfectly stitched and aligned:


fire_20.gif


18. Selecting the duplicate layer, flip it upside-down (Edit > Transform > Flip Vertical). You’ve just got yourself a nicer, perty fine stitch between the two, much finer than before the “flip”.

fire_21.gif


19. Merge the two layers into one (select them together with the “Shift” Key, then press CTRL+E)


20. Duplicate again the newly obtained layer and repeat the “stitching” - one layer on top of the other. We should now have a 4-canvases-high layer, something like this:

fire_22.gif


If you start moving this long layer up and down, you get the exact feeling of rising/falling flames. Find the file with everything we worked on, so far, here; I’ve also created an Actions set for you which, played in Photoshop, will pretty much take you step by step through all the above (get it here).



If you want to save a looping animation from this, I have a couple of tips for you:


1. Given that you’re never going to use such a BIG animation, I suggest you start from this file and make a smaller one - say about 200×200px (Image > Image Size…)


2. Align the bottom layer to the TOP + LEFT margins of the canvas


3. Save the image


4. Shift upwards the “background mobil” layer with 10 pixels (SHIFT + up-arrow)


5. Save the new image


6. Repeat steps 4-5 several times, till you get all the necessary files (2 canvases height) (at a 200px height and a 10px step you’ll need the first image plus 39 times the steps 4-5)


Once again, here’s what you’ve been sweating for:




1 comment:

Eros Nicolau said...

Hello,
I would like to know how did my tutorial end up on your blog, without my permission, without the due credits / link back to the original tutorial...