Contents

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:

  1. In Xcode, go to File > Add Packages.
  2. Paste the following repository URL into the search bar:

https://github.com/OKKHALIL3/ConvertTOCVPixelBuffer

  1. 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