Too many arguments error when converting .tiff to .bmp

8 ビュー (過去 30 日間)
Vanessa Phung
Vanessa Phung 2017 年 11 月 15 日
コメント済み: Vanessa Phung 2017 年 11 月 15 日
I am trying to convert .tiff image to .bmp using the code as below
A=imread('ref.tif'); B=imwrite(A,'ref.bmp');
However, it failed and show "too many arguments".
Any recommendation on solving this? Thank you.
  3 件のコメント
Vanessa Phung
Vanessa Phung 2017 年 11 月 15 日
Thanks.
Vanessa Phung
Vanessa Phung 2017 年 11 月 15 日
I tried for .bmp. The output figure is 'all-white'. However, it works with .png format. Thanks for the comment.

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

回答 (2 件)

M
M 2017 年 11 月 15 日
I don't think that imwrite returns an output. It should be used as
imwrite(A,map,filename)
  1 件のコメント
Vanessa Phung
Vanessa Phung 2017 年 11 月 15 日
It works for .png, but failed on .bmp

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


mounika
mounika 2017 年 11 月 15 日
Try this:
t = Tiff('ref.tiff','r');
imageData = read(t);
imwrite(imageData,'ref.bmp');
  1 件のコメント
Vanessa Phung
Vanessa Phung 2017 年 11 月 15 日
I got some message : Warning: TIFF library warning - 'TIFFReadDirectory: Unknown field with tag 50495 (0xc53f) encountered.' Error using writebmp (line 14) Expected X to be one of these types:
logical, uint8, single, double
Instead its type was uint16.
Error in imwrite (line 472) feval(fmt_s.write, data, map, filename, paramPairs{:});

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

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by