Well. The most complex part is done! Now you can simply assign a template texture for a spell and if you draw something similar (for ex. similarity > 0.85) from your database, appropriate spell will be chosen. The spell parameters affect the cast behavior.
https://giant.gfycat.com/GrimVeneratedChicken.gif
I will put it on Marketplace shortly after polishing the damage system.
P.S. Template example:
It is pretty simple to make those in PS.