def genPNGs(folder,files=None):
if files is None:<EOL><INDENT>files=glob.glob(folder+"<STR_LIT>")<EOL><DEDENT>new=[]<EOL>for fname in files:<EOL><INDENT>ext=os.path.basename(fname).split("<STR_LIT:.>")[-<NUM_LIT:1>].lower()<EOL>if ext in ['<STR_LIT>','<STR_LIT>']:<EOL><INDENT>if not os.path.exists(fname+"<STR_LIT>"):<EOL><INDENT>print("<STR_LIT>"%os.path.basename(fname))<EOL>cm.image_convert(fname)<EOL>new.append(fname) <EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>return new<EOL>
Convert each TIF to PNG. Return filenames of new PNGs.