 
 import UIKit
 
-public struct ImagePallete {
+public class ImagePallete {
     public var pixels: UnsafeMutableBufferPointer<Pixel>
+    public var imageData: UnsafeMutablePointer<Pixel>
     public var width: Int
     public var height: Int
     

        height = Int(image.size.height)
        
        let bytesPerRow = width * 4
        let imageData = UnsafeMutablePointer<Pixel>.allocate(capacity: width * height)
        
        let colorSpace = CGColorSpaceCreateDeviceRGB()
        

        imageContext.draw(cgImage, in: CGRect(origin: .zero, size: image.size))
        
        pixels = UnsafeMutableBufferPointer(start: imageData, count: width * height)
    }
    
    deinit {
        self.imageData.deallocate(capacity: width * height)
    }
    
    func calculateKMeans() -> [Pixel] {
