Вот простая функция для iOS, чтобы преобразовать из UIImage в массив без байтов char * byte ->
+ (unsigned char*)UIImageToByteArray:(UIImage*)image; {
unsigned char *imageData = (unsigned char*)(malloc( 4*image.size.width*image.size.height));
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGImageRef imageRef = [image CGImage];
CGContextRef bitmap = CGBitmapContextCreate( imageData,
image.size.width,
image.size.height,
8,
image.size.width*4,
colorSpace,
kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst);
CGContextDrawImage( bitmap, CGRectMake(0, 0, image.size.width, image.size.height), imageRef);
CGContextRelease( bitmap);
CGColorSpaceRelease( colorSpace);
return imageData;
}