glow
Create a palette-safe halo around pixel art using layered ramp rings, with optional edge dithering, on a separate layer so the original artwork stays unchanged.
Instructions
Halo a shape in rings of ramp steps, so it glows without leaving the palette.
`add_outline` gives one flat ring, which reads as a sticker. A glow is several rings,
each a step further down a ramp: hottest against the artwork, fading outward, with the
outer ring optionally dithered so it ends in something softer than a hard edge.
The ramp is what makes this different from a glow in an image editor. A halo made of
alpha, or of colours interpolated between two others, takes the art off its palette,
and then `palette_conformance` drops and the sprite no longer exports to an indexed
format, reuses a tileset, or matches the sprite beside it. Every pixel this writes is
exactly one of the colours you passed in.
The glow goes on its own layer below the artwork, so the subject's cel is untouched
and deleting one layer removes the effect.
Args:
ramp: Colours darkest first. Ring 1, touching the artwork, takes the top step and
the outermost ring takes `ramp[0]`, so a longer ramp fades more finely. For a
glow that reads as light rather than as a coloured border this usually wants
its own bright ramp (a gem's or a flame's), not the subject's body ramp.
radius: How many rings, in pixels. 2 or 3 reads as a glow; much more reads as fog.
falloff: "linear" spaces the steps evenly. "quadratic" drops away faster, keeping
a hotter core and a dimmer skirt, which is the one that reads as a light
source rather than as an outline.
dither_edge: Dither the outermost ring, so the glow ends in a half-density
scatter instead of a hard line. This is binary coverage, a pixel either drawn
or not, rather than a partial alpha, so every drawn pixel is still exactly a
ramp step and conformance stays at 1.0.
base_color: Glow only around pixels near this colour, which is how a gem glows
while the hand holding it does not. Distance is measured out from those
pixels, but the glow is never painted over any part of the subject layer, so
a body blocks the halo of a gem inside it.
tolerance: How close a pixel must be to `base_color` to be treated as a source,
as a weighted RGB distance. Ignored when `base_color` is omitted.
new_layer: Name for the glow's own layer, created directly below `layer`, or
reused when a previous call of this tool made it and `frame` has no cel on it
yet. That is how one glow layer carries a flickering torch across four frames
rather than needing four layers with one cel each. A second call for the same
layer *and* frame is refused, because two halos composited into one cel are a
picture neither call describes, and so is a layer of that name this tool did
not create.
layer: The layer to glow around (default: top layer). Its cel is never modified.
frame: Target frame, 1-based.
Refuses rather than drawing nothing: no pixel matching `base_color` is an error, and
so is a subject that leaves the glow nowhere to go.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ramp | Yes | ||
| frame | No | Default: 1. | |
| layer | No | ||
| radius | No | Default: 3. | |
| falloff | No | Default: "linear". | linear |
| filename | Yes | ||
| new_layer | No | Default: "glow". | glow |
| tolerance | No | Default: 24.0. | |
| base_color | No | ||
| dither_edge | No | Default: true. |