I actually don't want to do that because you can get different-sized image buffers with the same size images due to CALayer's renderInContext: adding byte padding to the end of each row in the image.