using imsave on a float array stretches the image to [0,255]. we should convert to uint8 before saving.