MATLAB: Load file and saving in other format (image files)

Image Processing Toolboxsave and load

I currently trying to write a code to load my image from a directory and loop each each of them in Matlab then i need to save my image files into another folder and save into another format for example png,jpg…here is the code for me to load the images file from my directory ,but I facing the problem when I trying to save the images into another format …anyone can tell me where is my problem because I am new on this
file = dir('C:\Users\doey\Documents\Sushi time ,Pv10'); file = file(~[file.isdir]); NF = length(file); images = cell(NF,1); for k = 1 : NF disp(file(k).name); images{k} = imread(fullfile('C:\Users\doey\Documents\Sushi time ,Pv10', file(k).name)); end savesas(file(k),'C:\Users\doey\Desktop\gg','png');

Best Answer

Like I said in my answer to your duplicate question, use "images" in imwrite(), not "image" . image is the name of a built in function. When you call image, you just get a handle id - a single number which is floating point. It's more than one, so you're essentially saving a single white pixel. Use "images" not "image".
Related Question