The warning mentioned in the title keeps appearing while trying to display an image in OpenCV2 with python 2.7.
How to get rid of this kind of warning?
The warning mentioned in the title keeps appearing while trying to display an image in OpenCV2 with python 2.7.
How to get rid of this kind of warning?
You can use pngcrush to remove the sBIT chunk:
pngcrush -rem sbit source.png fixed.png
In fact you don't even need to say -rem sbit
because pngcrush will detect the fact that the sBIT chunk is invalid and will silently remove it for you.
You could also try ImageMagick or GraphicsMagick
magick source.png fixed.png
gm convert source.png fixed.png
I believe that neither ImageMagick nor GraphicMagick supports writing the sBIT chunk, so it'll be removed whether or not it is valid.
Try running your image through pngcheck
to see if it is corrupt, or what is wrong with it. Then fix the source wherever you got it from.
sBIT refers to Significant bits. A chunk is used to convey information related to a particular image.
In your case, there is mostly an issue with the depth of the image you are using. The sBIT changes for every type of image. By type of image I mean: grayscale, RGB, grayscale with alpha, etc..
Visit THIS PAGE and scroll down to sBIT Significant bits section to learn more.