def METHOD_NAME(output_name, size):
    current_size = os.stat(output_name).st_size
    padcount = size - current_size
    if padcount < 0:
        print("[ERROR] image is larger than expected size")
        sys.exit(-1)
    output = open(output_name, "ab")
    output.write('\377' * padcount)
    output.close()