OpenCV Save Image Dramatically Increases File Size of .tif
Question: I'm using [OpenCV](http://opencv.willowgarage.com/wiki/) in Python to find
images within other images using the
[MatchTemplate](http://opencv.willowgarage.com/documentation/cpp/object_detection.html)
method. I've noticed that when I load a .tif file then re-save it, even if I
have not altered the image in opencv, the file size is increasing
dramatically, e.g., from 68kb to 25mb.

I wrote a very basic script to verify that this happens without any other code
modifying the image.

    
    
    import cv, sys
    
    filename = sys.argv[1]
    
    image = cv.LoadImage(filename)
    cv.SaveImage('test.tif', image)
    

I didn't see any options for optimizing the image. Any ideas on how I might be
able to maintain the original file size within OpenCV or is this just a matter
of compressing after the fact?


Answer: It could be that the source is compressed tif while the rewritten one is not
compressed.

See <https://code.ros.org/trac/opencv/ticket/1080> for a potential solution

