I generate monochromatic images and save them using imageio.imwrite
. Every time I save a file I get a following warning:
WARNING:root:Lossy conversion from float64 to uint8. Range [-0.24890179009891278, 2.35786261304524]. Convert image to uint8 prior to saving to suppress this warning.
I don't care for this "lossy conversion". Everything looks well and works fine.
However, every ~100 generated images I got different warning which I want to catch. Thus I want to ignore the above one.
I tried to ignore it, but even if I call
import warnings
warnings.simplefilter('ignore')
beforehand I still get this warning.