Am I using this incorrectly? All pixels appear empty.
let image = UIImage(named: "01", in: .main, with: nil)!
let rgbaImage = SwiftImage.Image<RGBA<UInt8>>(uiImage: image)
(0..<rgbaImage.width).forEach { x in
(0..<rgbaImage.height).forEach { y in
guard let pixel = rgbaImage.pixelAt(x: x, y: y) else { return }
// NOTE: pixel.red, green, blue and alpha are all 0 for every pixel
}
}
Am I using this incorrectly? All pixels appear empty.