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

조회 수: 1 (최근 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 CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by