Create img2pgm.m

convert image to pgm format