This project is just a list that contains Python code to create a Bitmap file out of an exported "Scan" list. See the studio: https://scratch.mit.edu/studios/31533631/
Here is the code: # create_bitmap.py # turns a Scratch screen scan into a 480 x 360 bitmap # !! no error checking here !! # expects a txt file with 172,800 bytes # !! must be scanned from bottom up !! filename = "scan" # set file basename here # read source file ( scanned image ) image = [] with open( filename + ".txt", "r" ) as scanfile: for i in range( 480* 360 ): pixel = int( scanfile.readline() ) image.append( pixel ) # write bitmap file with open( filename + ".bmp", "wb" ) as bitmapfile: # bitmap file header bitmapfile.write( bytes( "BM", "utf-8" ) ) file_size = 54 + ( 480 * 360 * 3 ) bitmapfile.write( file_size.to_bytes( 4, "little" ) ) reserved = 0 bitmapfile.write( reserved.to_bytes( 4, "little" ) ) image_offset = 54 bitmapfile.write( image_offset.to_bytes( 4, "little" ) ) # bitmap info header info_header_size = 40 bitmapfile.write( info_header_size.to_bytes( 4, "little" ) ) width = 480 bitmapfile.write( width.to_bytes( 4, "little" ) ) height = 360 bitmapfile.write( height.to_bytes( 4, "little" ) ) color_planes = 1 bitmapfile.write( color_planes.to_bytes( 2, "little" ) ) bits_per_pixel = 24 bitmapfile.write( bits_per_pixel.to_bytes( 2, "little" ) ) blank = 0 for i in range( 6 ): bitmapfile.write( blank.to_bytes( 4, "little" ) ) # pixel data for i in range( 480 * 360 ): color = image[i] bitmapfile.write( color.to_bytes( 3, "little" ) ) print( "file ", filename + ".bmp created" )