how to convert multiply jpg files to tiff

3 visualizaciones (últimos 30 días)
shuki firuz
shuki firuz el 22 de Feb. de 2022
Comentada: shuki firuz el 22 de Feb. de 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

Respuesta aceptada

KSSV
KSSV el 22 de Feb. de 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

Más respuestas (0)

Categorías

Más información sobre String Parsing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by