def add_margin(file_path, top, right, bottom, left, color):
    image = Image.open(file_path)
    (width, height) = image.size
    new_width = ((width + right) + left)
    new_height = ((height + top) + bottom)
    result = Image.new(image.mode, (new_width, new_height), color)
    result.paste(image, (left, top))
    temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
    temp_filename = temp_file.name
    result.save(temp_filename, dpi=(800, 800))
    return temp_filename
def add_margin(file_path, top, right, bottom, left, color):
    image = Image.open(file_path)
    (width, height) = image.size
    new_width = ((width + right) + left)
    new_height = ((height + top) + bottom)
    result = Image.new(image.mode, (new_width, new_height), color)
    result.paste(image, (left, top))
    temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
    temp_filename = temp_file.name
    result.save(temp_filename, dpi=(800, 800))
    return temp_filename