def create_bmp(width, height):
return b'\x42\x4D\x7A'+b'\x00'*7+b'\x7A\x00\x00\x00\x6C\x00\x00\x00' + width.to_bytes(4, 'little') + height.to_bytes(4, 'little') + b'\x01\x00\x18'+b'\x00'*9+b'\x13\x0B'*2+b'\x00'*10+b'RGBr'+b'\x00'*70
with open(sys.argv[1], 'wb') as file:
file.write(create_bmp(128, 256))