libpng warning: iCCP: known incorrect sRGB profile

 

 

问题:用cv2.imread读取jpg格式图像时出现警告。

原因:libpng 1.6及以上版本增强了ICC profiles检查,所以发出警告,需要删除ICCP profiles。有的地方可能直接变成 “错误”。  ——参考博客

解决:重新保存

import cv2

img = cv2.imread(i_path)
cv2.imencode('.png', img)[1].tofile(i_path)

* 上面的方法不会改变图像矩阵的具体值(无损)

* 和图像文件的具体格式无关

posted @ 2022-04-18 16:17  谷小雨  阅读(2786)  评论(0)    收藏  举报