Convert image to a c array.