how to convert multiply jpg files to tiff
4 次查看(过去 30 天)
显示 更早的评论
Hey,
I am new to matlab, I tried to convert multiply jpg files to tiff files, with no success.
I know i need to use this lines:
img = imread('FileName.jpg');
imwrite(img, 'FileName.tiff');
But how do I do that with multiply images.
thanks for the help
0 个评论
采纳的回答
KSSV
2022-2-22
jpgFiles = dir('*.jpg') ; % you are in the folder of all jpg files/ you may provde path as well
N = length(jpgFiles) ;
for i = 1:N
% Read
FileName = jpgFiles(i).name ;
img = imread(FileNAme);
% Write
[~,FileName,ext] = fileparts(FileName) ;
OutFile = strcat(FileName,'.tiff') ;
imwrite(img,OutFile);
end
更多回答(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!