title: CGImage from byte array
body: <p>Loading a CGImage or NSImage from a file using a standard image format (jpeg, gif, png et.) is all very simple. </p>
  
  <p>However, I now need to create a CGImage from an array in bytes in memory generated using libfreetype. Its really easy to create OpenGL textures from an array of formatted bytes, and I can see how to create a CGBitmapContext to <em>write</em> to. But I can't seem to find an easy way to create a CGImage from a raw pixel array.</p>