If you tried the demo and were remarkably unimpressed, give it a try again and it ought to work better (make sure and manually refresh - F5 so you don't have the old page cached).<p>I read how the MNIST data was generated and followed suit: Find the bounding box of the drawn image and scale it down to 20x20, preserving the aspect ratio. Put that 20x20 image into a 28x28 image using the center of mass of the pixels as the center point.<p>There is still some error due to how different mouse drawn and hand drawn numbers look, but I've found it to be a lot more accurate.<p>Demo: <a href="http://demofox.org/MNIST1.html" rel="nofollow">http://demofox.org/MNIST1.html</a><p>Example training data to see what i mean about difference between hand drawn and mouse drawn images: <a href="https://i2.wp.com/blog.demofox.org/wp-content/uploads/2017/03/mnist_100_digits1.png" rel="nofollow">https://i2.wp.com/blog.demofox.org/wp-content/uploads/2017/0...</a><p>Thanks for the feedback on that... it was a mistake rolling it out in such a broken state.