Ask Your Question

Revision history [back]

It seems you could used the parameters list of [imwrite](http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imwrite#bool imwrite(const string& filename, InputArray img, const vector<int>& params) to set some TIFF parameters. set TIFFTAG_COMPRESSION to COMPRESSION_NONE to avoid compression. TIFFTAG_BITSPERSAMPLE can only be 8 or 16, not 32. Is the DPI important? Because, if you have the same number of pixels, it only says the physical size of your image.

But all tests have made lead to an error if I don't used the LZW compression (with the last GIT version of OpenCV)! Which is quite strange because the parameters are read, according to the code in module/highgui/src/grfmt_tiff.cpp line 483 (even if 3 lines above the comment says the opposite). You could try to patch it or report the bug. If you patch it, please consider the other flags (see 3rdparty/libtiff/tiff.h for an overview).