Run in turbo mode (shift+click green flag) to go faster. I did not do any research and I have no idea how edge detection actually works. I was just looking back at old NPR projects, had this idea, and threw it together quickly. Kinda fun! :) Originally everything was way too gray, so to make things more extreme I wanted to find values close to 0 (dark) and drag them down even closer to 0, and find values close to 1 (light) and bring the up even closer to 1. To do that, I used this modified version of the Sigmoid function: https://www.desmos.com/calculator/kv1bvjnamk The sigmoid function is very useful in machine learning, and you can learn more about it here: https://en.wikipedia.org/wiki/Sigmoid_function I don't think people normally use it for this though. :P It was just the first idea I thought of.
Thanks a ton to @Layzej for the image and the image color data. :D Check out the NPR studio for more projects like this: https://scratch.mit.edu/studios/1440810/