- Back to Home »
- resize multiple images , resize multiple images using matlab »
- Resizing multiple images using MATLAB
Posted by : Mukunthan GJ
Saturday, 23 March 2013
Get all the image files that are need to be re sized in matlab current directory and run this code
dirData = dir('*.jpg');
fileNames = {dirData.name};
for iFile = 1:numel(fileNames)
newName = sprintf('%1d.jpg',iFile);
movefile(fileNames{iFile},newName);
end
After renaming the files (by running above program ) run this code
q=1;
p=1;
for i=1:10
oq=imread(strcat(num2str(q),'.jpg'));
odprz=imresize(oq,[150 150]); %# specify your size here
imwrite(odprz,strcat(num2str(p),'.png'));
q=q+1;
p=p+1;
end
collect only .png format files.That files are re-sized files.
Very good and simple! thank you
ReplyDeletevery much helpful. thanks a lot.
ReplyDeletewill you give me your email id plz?
Good post, it very knowledgeable..
ReplyDeleteCompress JPG online
Compress PNG
Online Image Optimizer
Online JPEG Compressor Tool
JPG Size Reducer
Photo Compressor
Convert PNG to JPG