UIImage 를 흑백으로 변환하는 법 extension UIImage { func convertToGrayScale() -> UIImage { let context = CIContext(options: nil) if let currentFilter = CIFilter(name: "CIPhotoEffectTonal") { let input = CIImage(image: self) currentFilter.setValue(input, forKey: kCIInputImageKey) if let output = currentFilter.outputImage, let cgImage = context.createCGImage(output, from: output.extent) { return UIImage(cgI..