in depth-anything-example/Common/CoreImageExtensions.swift [38:45]
func writePNG(_ image: CIImage, to url: URL) {
let outputCGImage = createCGImage(image, from: image.extent)!
guard let destination = CGImageDestinationCreateWithURL(url as CFURL, UTType.png.identifier as CFString, 1, nil) else {
fatalError("Failed to create an image destination.")
}
CGImageDestinationAddImage(destination, outputCGImage, nil)
CGImageDestinationFinalize(destination)
}