handle 16bit data
replace rgb/gray with sRGB / Y references
implement sRGB gamma and better RGBY conversion
process the data as float before quantization
output float in [o..1]