Removing double transpose and RGB channels' extraction on P assignment save me 66% of evaluation time (1.5min -> 30s approx on my laptop)
I'm not 100% confident with mathcad syntax, so I'm not sure about how U should works (added a possible interpretation)
Pattern Julia RemToDo.sm (107 KiB) downloaded 30 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects