okkhalil3/converttocvpixelbuffer
A Swift library that provides an easy-to-use function to convert **UIImage** objects into **CVPixelBuffer**. This is useful for image processing tasks, such as feeding images into Core ML models.
Features
- Converts UIImage to CVPixelBuffer.
- Simple and straightforward API.
- For iOS 15.0 and later.
Requirements
- iOS: 15.0 or later
- Swift: 6.0 or later
Installation
Swift Package Manager
To add ConvertTOCVPixelBuffer to your project:
- In Xcode, go to File > Add Packages.
- Paste the following repository URL into the search bar:
https://github.com/OKKHALIL3/ConvertTOCVPixelBuffer
- Select the package and click Add Package.
Usage
Import the Library
Once added to your project, import the library in your Swift file:
import ConvertUIImage
if let pixelBuffer = convertImageToPixelBuffer(image: yourImage ?? backupImage, imageWidth: width, imageHeight: height) {
//your code
}Package Metadata
Repository: okkhalil3/converttocvpixelbuffer
Default branch: main
README: README.md