How to save png images into one tiff file format with export_fig?

2 ビュー (過去 30 日間)
Veronika
Veronika 2017 年 4 月 16 日
回答済み: Walter Roberson 2017 年 4 月 22 日
Dear all,
I have images in png format and I would like to save these images into one tiff. I found function export_fig at this link: http://www.mathworks.com/matlabcentral/fileexchange/23629-export-fig But I don´t know, where I can put images for transfer to tiff. I try this in export_fig.m:
fig = get(0, 'Binarizace_okoli_ 1.png');
[fig, options] = parse_args(nargout, fig, varargin{:});
but this is only one (first) image of my images.
Even so this error appears:
Error using get
There is no Binarizace_okoli_ 1.png property on the Root class.
Error in export_fig (line 265)
fig = get(0, 'Binarizace_okoli_ 1.png');
Can you advice me, where I put or load my images to transfer into tiff?
Thank you for your answers.

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 4 月 22 日
projectdir = '.'; %name of folder where images are
output_tiff = 'MyMultipage.tif';
dinfo = dir( fullfile(projectdir, '*.png') );
filenames = fullfile(projectdir, {dinfo.name} );
for K = 1 : length(filenames)
this_data = imread(filenames{K});
if K == 1
imwrite(this_data, output_tiff);
else
imwrite(this_data, output_tiff, 'WriteMode', 'append');
end
end
This has nothing to do with export_fig()

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by