Why does the png-file-size increase? Here is the code (in Java):
Mat m = Highgui.imread("C:/img1.png");
Highgui.imwrite("C:/img1out.png", m);
Initially the "img1.png"-file is 900kb, but "img1out.png" becomes 2200kb! I have read that the compression in openCV is not as good as in other image-processing API's, but recently some compression has been added.
I tried out to do this here:
Mat m = Highgui.imread("C:/img1.png");
MatOfInt mPngCompressionRate = new MatOfInt(9);
Highgui.imwrite("C:/img1out.png", m, mPngCompressionRate);
But it saves only a completely black image. What am i doing wrong here ?