/Tutorials Web demo All tutorials ← Site

How to animate pixel art fire from a still drawing

Fire is the effect that most rewards simulation. Flames are not a shape you draw, they are a process — heat rising, flickering, fading out. Describe the process once and every frame draws itself.

Phluxel · Windows · a free edition covers everything on this page

What you need

The steps

Step 1

Paint the scene once

Draw your background, characters and props as a single still image — or import a PNG you already have. There are no layers to set up: the picture you paint is the simulation state, which is why the effect can react to it.

Step 2

Add the rule

Open the Rule Editor and create a new rule, or pick Flames (from embers, BASE) from the template list and skip the typing. This is the whole thing:

Flames (from embers, BASE)Phlux
PARAM _flicker = 6; PARAM _reach = 42;
LET _h = {SAT, {AVG,(-1:1,1:2).R} - RN * _flicker * 0.01 - 8};
BASE.R > 239 & BASE.G < 50 ? [255, 255, 90 + RN * 0.35, 16] :
(BASE.G > 49 ? [BASE] :
(_h < _reach ? [BASE] :
[255, _h, {SAT, _h * 0.75 - 55}, {SAT, _h * 0.22 - 38}]))

_flicker is how jittery the flame is, and _reach is how high it climbs — lower _reach means taller flames. Both are live sliders in the rule editor, so you can dial the look while it plays.

Step 3

Turn Global on

Toggle the globe icon on the rule so it applies to every cell rather than only the cells you painted it onto. Effects that sweep across a scene are almost always global.

Step 4

Press play

The grid starts stepping immediately. Adjust the live parameters below the script while it runs — you do not need to stop and restart to see a change.

Step 5

Export the loop

File ▸ Export ▸ Animation. Set the frame count to the length of one cycle and Phluxel writes a seamlessly looping GIF. The same dialog exports MP4 and APNG, and there is a separate sprite sheet export if you are taking this into a game engine.

Why it goes behind your artwork

Solid parts of the scene are restored from BASE on every step, so the fire never eats your artwork no matter how long it burns.

This is the part that usually surprises people coming from layer-based tools. There is no effect layer to composite. BASE is a token that always reads the original, untouched version of the cell, so a rule can paint over your scene one step and hand it back the next.

Paint the ember core pure red. Flames grow out of cells that are pure red — red above 240 with green below 50. That is the fuel. Anything with green at 50 or above is treated as solid scenery, so logs, stones and background all keep their colour and the flames pass behind them.

Making it loop seamlessly

Set Max steps in the Playback panel to the number of frames you want, and the simulation returns to the start when it reaches that count. Export the same number of frames and the GIF has no visible seam. If the loop still jumps, the usual cause is a motion cycle that does not divide evenly into the frame count — a drop that needs 21 steps to cross a 20-frame loop will always stutter.

Tip. The timeline can ramp a parameter while the loop plays. Keyframe _rate from low to high and the weather builds over the animation instead of staying constant.

Try it without installing anything

Phluxel runs in the browser as a demo, and the free desktop edition has every feature with a watermark on exports.

Open the browser demo Download free (Windows) Wishlist on Steam

More Phluxel tutorials

How to animate rain over pixel artPaint it once, then one rule animates it. How to animate falling snow in pixel artPaint it once, then one rule animates it. How to convert an image into pixel art with a locked paletteDownscale cleanly and snap the result to a Lospec palette.