CardBaker.module
README.md
CardBaker
Authoring-time image tool for alpha-cut foliage cards. CB.bake(name, srcPng, { seasons, fix }) keys a plant or leaf picture painted on a flat magenta / cyan / yellow background into a clean cut-out (key colour measured from the corners, background unmixed out of the edge pixels, residual spill removed, speckles dropped, leaf colour bled into the transparent area so mipmaps never pull the key in), saves <name>_albedo and a shading-derived <name>_normal (green-up) at 512 px, and a <name>_<season>_albedo per seasonal recolour. CB.recolour moves only leafy pixels (a hue range, greens by default) toward a palette, mottled per leaf by low-frequency noise; CB.TREE, CB.FERN, CB.GRASS, CB.BRAMBLE, CB.HAZEL hold the season palettes. Used by forestMaterials' authors; nothing calls it at runtime.