Add support for writing image data output to a buffer, boosting ops/sec by ~7%. Partially implements #3.