imwrite error saying 'TransparentColor' is not a recognized parameter
显示 更早的评论
I am trying to remove the black background created when using imwarp and read that it can be done when exporting the images. the error I get is:
Error using writetif>parse_param_value_pairs (line 161)
'TransparentColor' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for this function.
However when using
doc imwrite
it exist as a Name-Value pair argument (imwrite) with the example 'TransparentColor', 20. So therefore I added 20 jut to try it out (black might be another colour).
This is part of the code I am trying to get to work, where movingReg is a uint8 object. Why is it giving me this error?
imwrite(movingReg ,fullfile('C:\Users\X\Documents\Matlab\multiplex\55D-A',string(['moved',num2str(number(num)),'.TIF'])),'TransparentColor',20);
采纳的回答
更多回答(1 个)
Steven Lord
2020-1-8
0 个投票
That argument appears in a section on the documentation page describing functionality available for the GIF format, not for the TIFF format. Some of the options are supported for several of the formats (WriteMode is supported for both GIF and TIFF, for example) while others are specific to just one of the formats (like TransparentColor to GIF.)
类别
在 帮助中心 和 File Exchange 中查找有关 Images 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!