fid=fopen("names.txt","r");
folder="jpg-/";
name=fgetl(fid);
while (name != -1)
final=strcat(folder,name);
I = imread(final);
I = rgb2gray(I);
imwrite(uint8(I), final);
name=fgetl(fid);
endwhile
fclose(fid);
