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

I wanted to try some simple file operations, and I started by opening and saving files (I use Python)

image = cv2.imread("image.png")
cv2.imwrite("image_processed.png", image)

After this operation, my original image33kB image is converted to the same 144kB image.

I tried to do something like this: http://opencv.itseez.com/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imwrite#imwrite

    params = list()
    params.append(cv.CV_IMWRITE_PNG_COMPRESSION)
    params.append(8)

    image = cv2.imread("image.png")
    cv2.imwrite("image_processed.png",image,params)

But that hasn’t changed much (the size has decreased to 132 KB)

This is the image I'm working with:

enter image description here

+9
source share
4 answers

png, GIMP, PNG, libpng, opencv. Imagemagick , ( OpenCV).

, PNG, pngcrush.

, ? .

+6

ypnos, jpg ( png). , png, , (jpg png).

:

cv2.imwrite("image_processed.jpg",image,params)

, .

, , , http://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png

+4

, matplotlib.image.imsave - ​​ 8- 16-, , scipy.misc.bytescale, , 8 - . scipy.misc.imsave 8- .

+1

All Articles