a crude HDR compression algorithm