I have followed the instructions from (just to name a few): How to get pixel data from a UIImage (Cocoa Touch) or CGImage (Core Graphics)? Re: Get pixel data as array from UIImage/CGImage in swift Get pixel data as array from UIImage/CGImage in swift
My problem is that in some cases, when trying to get pixel values for a 100x100 PNG image, the pixels come out wrong. For example, getting an image from a bitmap taken from the same image by using the CGContext yields these results: