如何从Swift 3中的UIImage / CGImage获取2d强度数组

时间:2017-06-15 04:11:43

标签: ios swift uiimage cgimage

我已按照说明(仅举几例): 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

我的问题是,在某些情况下,当尝试获取100x100 PNG图像的像素值时,像素出错了。例如,通过使用CGContext从同一图像中获取位图来获取这些结果:

enter image description here

enter image description here

0 个答案:

没有答案