フィルターのクリア

Why is imwrite images has small size?

3 ビュー (過去 30 日間)
Irfan Tahir
Irfan Tahir 2017 年 2 月 22 日
コメント済み: Irfan Tahir 2017 年 2 月 22 日
Hi, I guess i am not much of a expert on the subject. So after reading the 24 MP image as a Tiff which is 138 mb in size. and then extracting only the blue channel and writing it again doesnt add up. The blue channel image will come up to be 3,95 mb rather than 11,5 mb.
Input=4016x6016x3 uint16 size = 138mb
Output=2008x3008 uint 16 = 3,95mb
the operation i perform
clear all
for i=1:10
b=imread((strcat(num2str(i),'.tiff')));
im=b(2:2:4016,2:2:6016);
imwrite(im,strcat('blue',num2str(i),'.tiff'));
end
the pixel pattern was beyer so I was only interested in Blue pixel and not the interpolation of blue channel in all the pixels. Thanks
  1 件のコメント
KSSV
KSSV 2017 年 2 月 22 日
How about taking
im=b(2:2:4016,2:2:6016);
as
im=b(:,:,3);

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2017 年 2 月 22 日
Look at https://www.mathworks.com/help/matlab/ref/imwrite.html#input_argument_namevalue_ColorSpace and scroll down very slightly to Compression. Notice there that there are a number of different compression possibilities for TIFF files, and that packbits is the default. So by default, what you imwrite() to a TIFF file will undergo loss-less compression as it is stored to disk.
The input file that you were reading might perhaps not be compressed at all.
  1 件のコメント
Irfan Tahir
Irfan Tahir 2017 年 2 月 22 日
Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by