Hi. I wanna resize image without changing DPI and bit level. So I use this code.
[
vector<int> params2; params2.push_back(IMWRITE_TIFF_XDPI); params2.push_back(XDPI); // XDPI is same with original's params2.push_back(IMWRITE_TIFF_YDPI); params2.push_back(YDPI); // YDPI is same with original's
resize(ori_image, resized_image, Size(ori_image.cols , ori_image.rows));
imwrite("resized_test_image.tif", resized_image, params2);
]
I solved DPI problem with 'IMWRITE_TIFF_XDPI' But I dont know how to fix bit level. There is 'IMWRITE_PNG_BILEVEL ' in 'ImwriteFlags' for Binary level PNG, 0 or 1, default is 0. But it cannot use for tiff image. Original image's bit level is 1 but resized image's bit level is 8. How can I fix bit level?? Or use other codes like dithering?