That looks to me just overcomplicating what is already the most straightforward way: a tileset image with all characters + all 16 colors already there.
The more control the better. The less code the better. There’s absolutely zero need to use mathematical formulas to calculate colors or luminosity.
What I need to know as a tilemaker is:
1- The right sequence of characters. Or the order they have to have in the tileset image.
2- The right sequence of colors they have to have in the tileset image.
That’s all.
All you say about “The index must be the same for every image, so it has to be decided in advance how many we’ll use” this makes no sense to me. No one has to “decide” anything because what is used and how entirely and solely depends on how the terminal game works. This is a fallback mechanic for tiles, this means that it need the same granularity as there is in the ASCII version. See how many ASCII and colors the console version uses, and that’s it. If there are 16 colors, we need 16 colors.