public static float[] GetRGBManhattanLengthTo(this Bitmap a, Bitmap b) { if (a.Width != b.Width || a.Height != b.Height) { throw new ArgumentException("bitmaps must be of same size", nameof(b)); } var mlenghs = new List <float>(); for (int i = 0; i < a.Data.Length; i += 4) { var av = a.Data.GetVec4(i); var bv = b.Data.GetVec4(i); bool isTransparent = av.W == 0 || bv.W == 0; var rgb = isTransparent ? 0.0f : Vec4.Abs(bv - av) .GetVec3() .LengthManhattan(); mlenghs.Add(rgb); } return(mlenghs.ToArray()); }