Code to pack bitmaps in bigger bitmaps, and support code for using images as targets for Cocoa drawing.