FireLink

Version 3.3 — © 1996-2003 Christian Cohnen

The fire effect is one of the most iconic demoscene tricks — every demo on the Amiga, Atari ST or PC had one. The algorithm is beautifully simple: seed random hot pixels at the bottom of the screen, then propagate upward by averaging each pixel with its neighbors below and subtracting a small cooling factor. The result is a surprisingly realistic flame that rises, flickers and fades — all from a few lines of integer math and a color palette lookup.

FireLink wraps this classic effect into a clickable banner applet. A transparent foreground image (the link text or logo) floats over the flames, with an optional second image for mouseover state. The three-color gradient (backColormidColorendColor) lets you create anything from traditional red/yellow fire to white smoke, green plasma or blue ice. The cool parameter controls flame height, and with mouse enabled you can paint fire with the cursor.

Originally a Java applet (1997). The JavaScript/Canvas port uses the same fire algorithm but renders into an HTML5 <canvas> via ImageData. Overlay images are loaded as standard <img> elements and composited per-pixel with alpha blending.

Features

Applet Parameters

NameTypeDescriptionDefault
imagefilenameTransparent foreground image (GIF) shown over the fire
image2filenameAlternative image shown on mouseover
coolint (0–16)Cooling factor — higher values produce shorter flames1
spotsintNumber of new fire hotspots seeded at the bottom each framewidth/16
clearsintNumber of bottom pixels cleared each framewidth/8
mouseEnable mouse-as-torch (presence enables it)off
backColorhex colorColor gradient start (coldest)#000000
midColorhex colorColor gradient midpoint#FF0000
endColorhex colorColor gradient end (hottest)#00FFFF

Parameters (FIRELINK_CFG)

NameTypeDescriptionDefault
coolintCooling factor 0–16 (higher = shorter flames)1
spotsintHot spots seeded per framewidth/16
clearsintSpots cleared per framewidth/8
mousebooleanEnable mouse/touch-as-torchfalse
backColorstringGradient start hex color"#000000"
midColorstringGradient midpoint hex color"#FF0000"
endColorstringGradient end hex color"#00FFFF"

Applet Code Example

<applet archive="FireLink.jar"
  code="FireLink.class" width="100" height="30">
  <param name="link" value="https://www.chriscohnen.de">
  <param name="image" value="hotlink.gif">
  <param name="cool" value="2">
  <param name="spots" value="20">
  <param name="clears" value="10">
  <param name="backColor" value="#000000">
  <param name="midColor" value="#FF0000">
  <param name="endColor" value="#FFFF66">
</applet>

JavaScript Canvas Version

<canvas id="game" width="200" height="60"></canvas>
<img id="overlay" src="hotlink.gif" style="display:none">
<script>var FIRELINK_CFG = { cool: 2, spots: 20, mouse: true };</script>
<script src="firelink.min.js"></script>

Version History

VersionDateChanges
2.1May 1997First public version — link image with background fire
3.0November 1999Mouseover image, target window, renamed “pic” to “image”
3.2November 2003Build system, obfuscation
3.3August 2004Fixed left mouse click to link