How to save png images into one tiff file format with export_fig?
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
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()
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!