Comparing two images
Though I didn't check the whole program and, according to you, performance is good enough, I do have one performance related suggestion:

avoid int64(math.Abs(float64(var1-var2))). Casting between int and float types is not free. Just read about Two's complement for ints and how floats are represented in the IEEE 754 standard. That conversion is not trivial!

As Go (as far as I know) doesn't have an abs method for int-like types, this may provide inspiration on how to calculate the abs for signed ints.