I am using BLOCKPROC to perform "file to file" image processing on large TIF images.
fun = @(block_struct) imresize(block_struct.data,.5);I = imread('penguin.tif');%create and write with blockproc directly
blockproc(I,[20 20],fun,'Destination','TEST_blockproc.tif');%create with blockproc and write with imwrite
I2=blockproc(I,[20 20],fun);imwrite(I2,'TEST_imwrite.tif','tif')%The image displays ok in MATLAB
imshow(I2) %just fine
%But if I open the file outside of MATLAB it may not open correctly
winopen('TEST_blockproc.tif') %fails
winopen('TEST_imwrite.tif') %works
%Behavior may be different depending on your default TIF viewer that opens the image.
Best Answer