out seems to be unnecessarily large for one byte per pixel