투케이2K

279. (ios/swift) [간단 소스] UIImage , CIImage , CGImage 형 변환 수행 실시 본문

IOS

279. (ios/swift) [간단 소스] UIImage , CIImage , CGImage 형 변환 수행 실시

투케이2K 2022. 11. 13. 14:34

[개발 환경 설정]

개발 툴 : XCODE

개발 언어 : SWIFT

 

[설 명]

[UIImage to CIImage]

// [UIImage >> CIImage]
let ciImage = CIImage(image: uiImage)



// [CIImage >> UIImage]
let uiImage = UIImage(ciImage: ciImage)









[UIImage to CGImage]

// [UIImage >> CGImage]
let ciImage = CIImage(image: uiImage)
let ciContext = CIContext(options: nil)
let cgImage = ciContext.createCGImage(ciImage, from: ciImage.extent)



// [CGImage >> UIImage]
let uiImage = UIImage(cgImage: cgImage)

 

반응형
Comments