Depends on the floor sprites. Each floor material would need a pre-made set of ramps. There are 40 grasses and 231 inorganics, plus some river/brook/magma/ice/(a few) mushroom-cap ramps. Let's make it 300 possible floor materials. Now those can mostly be rough, smoothed or engraved. Makes around 900.
All of which might have a track-tile on top, of any of the track directions, of which there are 14. Those need the correct shading of course.
Rekovs set has 72 ramps.
So you have 900*14*72 sprites. Just a meager 907.200 sprites.
Obviously I'm exaggerating a tiny bit, but yeah, automated shading by adding a brightness layer is the nicer solution in the end. Especially for modders/tileset authors adding their own content.
Although I don't know where 231 inorganic floors is coming from, surely they can mostly just be grouped as soil, sand, stone, smoothed stone, engraved stone, and like a dozen constructed types (even including blocks)? It's not like you'd have to apply it separately to dynamic stuff like material colors. Although representing different stones accurately is important for a game that spends so much player time underground, how many stone types really need their own texture? After all, their form is mostly determined by what's been done to them and things like grain size are gonna be
Not every time it loads -- every time it's built.
This means the game ships with the pre-generated files, and without the generation script. The script would reside only in Toady's development directory.
Since it's top down, there's no inherent need to use script for this. You can also just make ramps an overlay with either alpha transparency. Even though there's alpha, you only need one color channel so it'll still be smaller than normal images. (polychromatic images could be supported but I can't think why you would want to in this case, even in the context of modding.
You can also screen, which would allow for more vibrant colors in the sunlight, but it becomes more hassle for shadows.
If you wanted both, You could do a channel of screen and another of multiply for maximum freedom in what can be done, but that gets complicated both for the CPU (every pixel takes four operations on every rendered channel since screen requires inversion twice, so 12 total) as opposed to one per color (3) with a basic transparent blend, and also for modders who don't know that much about images. In that case, it might be easier to have a set of single-channel (aka monochrome) images, one for subtract and one for multiply, and then applying them is the only case where I think using a script might make sense. Then, assuming the graphics will still be duplicated per-save, it could make sense for the script to run automatically during worldgen. However, honestly, 907,200 sprites generated seems like a lot no matter what the circumstance, especially if that number goes up by 1008 every time a modder adds a grass or floor type. EDIT: Wrote this before your post where you realized that too.