Convert image to grayscale
// Not following Swift naming conventions, should be bytesPerPixel
let BytesPerPixel = 4

// Better to make function throwable and throw specific error.
guard let srcProv = srcImg.dataProvider else { fatalError("dataProvider is nil") }
guard let srcProvData = srcProv.data else { fatalError("dataProvider.data is nil") }


For unwrap of srcImg.colorSpace! is not good solution, I would recommend to use guard ... else and throw an exception if value is nil.

Overall: why you are using abbreviations and shortcuts for every variable/constant name? It is much harder to read such code