OpenCV - imread(), imwrite() increases the size of png?

后端 未结 4 1594
孤街浪徒
孤街浪徒 2020-12-29 08:12

I wanted to try out some simple operations on files and I started with opening and saving files (I use Python)

image = cv2.imread(\"image.png\")
cv2.imwrite(         


        
4条回答
  •  伪装坚强ぢ
    2020-12-29 09:07

    You can use a third-party command line tool optipng to re-compress and shrink the png file size without losing anything.

    Reference:

    http://optipng.sourceforge.net/pngtech/optipng.html

    https://github.com/johnpaulada/optipng

提交回复
热议问题