 import UIKit
 
 public struct RGBAImage {
-    public var pixels: UnsafeMutableBufferPointer<Pixel>
+    public var pixels: [Pixel] = []
     public var width: Int
     public var height: Int
     

        
        imageContext.draw(cgImage, in: CGRect(origin: .zero, size: image.size))
        
        pixels = UnsafeMutableBufferPointer<Pixel>(start: imageData, count: width * height)
    }
    
    public func pixel(x: Int, y: Int) -> Pixel? {

        
        let bytesPerRow = width * 4
        let imageData = UnsafeMutablePointer<Pixel>.allocate(capacity: width * height)
        
        defer {
            imageData.deallocate(capacity: width * height)
        }
        
        let colorSpace = CGColorSpaceCreateDeviceRGB()
        
        var bitmapInfo: UInt32 = CGBitmapInfo.byteOrder32Big.rawValue
