@@ -0,0 +1,843 @@
+import glob%0Afrom PIL import Image%0Afrom math import floor%0Apalette = %5B%5B0,0,0%5D%5D;%0A%0Adef transform( pixel ):%0A    return %5B 20 * ( pixel%5B 0 %5D / 20), 20 * ( pixel%5B 1 %5D / 20), 20 * ( pixel%5B 2 %5D / 20 ) %5D%0A%0Adef add_to_palette( filename ):%0A    imgFile = Image.open( filename )%0A    img = imgFile.load()%0A    for y in range( 0, imgFile.height ):%0A        for x in range( 0, imgFile.width ):%0A            pixel = img%5B x, y %5D%0A            adjusted = transform( pixel )%0A%0A            if pixel%5B 3 %5D %3C 254:%0A                adjusted = %5B 255, 0, 255 %5D%0A                %0A            if palette.count( adjusted ) == 0:%0A                palette.append( adjusted )%0A%0Afor filename in glob.glob('res/*.png'):%0A    add_to_palette( filename )%0A%0Apalette.sort()%0A%0Aprint len( palette )%0A%0Afor pixel in palette:%0A    print str(pixel%5B 0 %5D ) + %22%5Ct%22 + str(pixel%5B 1 %5D ) + %22%5Ct%22 + str(pixel%5B 2 %5D )%0A

Add utility to extract palette for the DOS version