Too many arguments error when converting .tiff to .bmp

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: did you read the imwrite documentation? Does that documentation show any output arguments for imwrite? Why do you have an output argument in your code?:
B=imwrite(A,'ref.bmp');
Thanks.
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)
mounika
mounika 2017년 11월 15일
Try this:
t = Tiff('ref.tiff','r');
imageData = read(t);
imwrite(imageData,'ref.bmp');

댓글 수: 1

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{:});

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

질문:

2017년 11월 15일

댓글:

2017년 11월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by