Encode arbitrary data as a PNG image.