how to convert multiply jpg files to tiff

11 Ansichten (letzte 30 Tage)
shuki firuz
shuki firuz am 22 Feb. 2022
Kommentiert: shuki firuz am 22 Feb. 2022
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

Akzeptierte Antwort

KSSV
KSSV am 22 Feb. 2022
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

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by