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

后端 未结 4 1626
孤街浪徒
孤街浪徒 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 08:46

    Some png writers like GIMP write much better compressed PNGs than standard libpng, which is used by opencv. You can also open and save the image again with Imagemagick, and see what difference that makes (as compared to OpenCV).

    There is even specialized software that tries to better re-compress PNGs, like pngcrush.

    Can you provide the image in question? I would like to play with it, regarding file size optimization.

提交回复
热议问题