Skip to content

All pixels are returned as transparent #58

@Codeglee

Description

@Codeglee

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
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions