imagescount = 25;

for imgnum = [1:imagescount]
	filename = [num2str(imgnum), ".jpg"];
	rawimg = imread(filename);
	threshimg = rawimg < 50;
	skel = bwmorph(threshimg, 'thin', Inf);
	imwrite([num2str(imgnum), "-skel.jpg"], skel*255);
	imwrite([num2str(imgnum), "-comb.jpg"], (skel == 0 + threshimg) * 255);
endfor

#I = imread("1.jpg");
#ceil(i * -1 / 255 + 1);

#skel = bwmorph(im>0,'thin',Inf); 
#skel = bwmorph(im,'skel',Inf);