minimize allocation calls when saving
support saving luminance format
compression support for more file types