Paperdoll layers

Cleaning loops

An animation model leaves ghost pixels around a moving figure: pale arcs beside the head, fragments off a hand or a foot. A layer cleans the frames on its own sheet, but the loop's files are what your game draws the layer over, so clean those too:

"hero.walk.south": { "animation": { "of": "hero", "template": "walking", "direction": "south", "clean": true } }

One walk frame of the first test character, shown keyed cyan, before cleaning with a pale halo beside the head and arm, and after

Each frame is judged against the parent's rotations. A colour the rotations barely use, on the outside of the figure, is debris; so is a fragment in such colours that outline has sealed off beside the figure. Colours the rotations do use are never removed.

Measured on that character's walk: 608 stray near-white pixels across 48 frames before, 2 after. Run over the 8 rotations themselves, it removed 1 pixel.

Check the limbs afterwards. Cleaning goes by colour, and a model sometimes shades a far arm or leg in a dark colour the rotations never use. On the second character's walk away from the viewer one frame had a whole leg drawn that way, sealed in its own outline, and cleaning erased it: 93 pixels. That case is now left alone, since a sealed patch bigger than 24 pixels or 6% of the body is taken for a limb, and the 48 frames above clean exactly as before. A smaller case is not caught: the same walk had an arm edged in that dark colour, and cleaning shaved 19 pixels off it. A loop that comes back like that is better regenerated than cleaned.

Cleaning is post-processing. Turning it on for a loop that is already downloaded shows in plan as recoverable, and pixelkiln fetch re-processes the frames at no cost. Do it before generating layers: a loop the cleaning changed makes a layer over it stale.

More in Characters.