Wow! that's amazing. Thank you very much for sharing the formula :) it's definitely worth a try... I mean, purely academic...
I don't know what Godot's array limit is, but I think 24-bit is very plausible. The bigger challenge would be having a texture that long, performance wise.