Add measurements to optimize, and then optimized the euclidean function

Euclidean was taking 200ns, dropped it down to 20ns by using diff*diff
instead of math.Pow(diff, 2). Possibly an optimization point for
math.Pow to add?

Also, support PNG and GIF.