I have images of type float64 generated by GANs, and I save them through skimage.io.imsave
. The process works well and the saved image looks nice, but I get a warning message as follows:
Lossy conversion from float64 to uint8. Range [-0.9999998807907104, 0.9999175071716309]. Convert image to uint8 prior to saving to suppress this warning.
Then I try to get rid of this warning by convert images to uint8 before saving using function skimage.img_as_ubyte
. This gives me a apparently much darker image with a warning
UserWarning: Possible precision loss when converting from float64 to uint8 .format(dtypeobj_in, dtypeobj_out))
I've also tried to use other functions such as the one from tensorflow tf.image.convert_image_dtype
before saving. They all return a darker image than I directly call skimage.io.imsave. What's the problem here?
Here's a set of images generated by converting to uint8 before saving