How to store resize images into new directory?
Show older comments
When I resize single image and store into new directory, it is working properly
filename='E:\img\xyz.jpg';
im = imread('E:\img\xyz.jpg');
k=imresize(im,[300,300]);
imwrite(k,'E:/Resizeimage/aa.jpg','jpg');
But when I resize all images from one directory and try to store into new directory, it is not working properly. I am posting here code. Can anybody tell me what is the problem?
srcFiles = dir('E:\img\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('E:\img\',srcFiles(i).name);
im = imread(filename);
k=imresize(im,[300,300]);
nm= 'E;/Resizeimage/';
nm1='srcFiles(i).name';
strcat(nm,nm1);
imwrite(k,nm,'jpg');
end
6 Comments
anu
on 1 Dec 2016
Amal Soltan
on 24 Nov 2017
would u plz tell us how do you have solved the problem as i'm facing same problem in imwrite function As i found the new image folder is empty,
anu
on 21 Dec 2017
rakesh kumar y
on 15 Dec 2020
thank you it helped me
SUJIT KRISHNANKUTTY
on 15 Jun 2021
Thank you, it helped me too!!
Luqmaan Ahmad Zaidi
on 13 Dec 2022
Thank you!
Accepted Answer
More Answers (0)
Categories
Find more on High Dynamic Range Images in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!