tf.image.convert_image_dtype(image, dtype, saturate=False, name=None)
Convert image to dtype, scaling its values if needed.
Images that are represented using floating point values are expected to have values in the range [0,1). Image data stored in integer data types are expected to have values in the range [0,MAX], where MAX is the largest positive representable number for the data type.
This op converts between data types, scaling the values appropriately before casting.
Note that converting