<filename>add_watermark.py
import time, os, argparse
from PIL import Image

parser = argparse.ArgumentParser(prog='add_watermark', 
                                description='Adds a watermark on top of images')

#parser.add_argument('-input', action='store', metavar='path', type=str, help='set a different input folder')
#parser.add_argument('-output', action='store',metavar='path', type=str, help='set a different output folder')
parser.add_argument('-sbs', action='store_true', help='adds a prompt after each step is completed')
parser.add_argument('-drw', action='store_true', help='resize watermark if input image size is different')
parser.add_argument('-dst', action='store_true', help='don\'t show time taken')
parser.add_argument('-si', action='store_true', help='show input file list')
parser.add_argument('-so', action='store_true', help='show output file list')

args = parser.parse_args()

input_folder = None #args.input
output_folder = None #args.output
dont_skip = args.sbs
resize_watermark = args.drw
show_time = args.dst
show_input = args.si
show_output = args.so

input_folder = input_folder+"\\" if input_folder != None else os.getcwd()+"\\input\\"
output_folder = output_folder+"\\" if output_folder != None else os.getcwd()+"\\output\\"
resize_watermark = False if resize_watermark else True
show_time = False if show_time else True

def pause_cls(): # Function that adds a "Press any button" prompt and then clears the screen
    global dont_skip
    print("\n", end="") # Prints a newline
    if (dont_skip):
        os.system("PAUSE")
        os.system("CLS")

os.system("COLOR 0F")
os.system("CLS")
print("Watermarker\nhttps://github.com/Lungu19")
pause_cls()

# Makes a list of all the files in the 'input' subdirectory
input_file_list = [f for f in os.listdir(input_folder) if os.path.isfile(os.path.join(input_folder, f))]

# Prints to the console the input file list
if show_input:
    print("Input file list:")
    for f in input_file_list:
        print(f + " ")

pause_cls()

watermark = Image.open("watermark.png") # Opens the watermark image
epoch_before = time.time()
out_f_list = ""

# Copies the watermark on top of each image
for image in input_file_list:
    input_Image = Image.open(input_folder+image) # Opens the image

    if (input_Image.width != watermark.width or input_Image.height != watermark.height) and resize_watermark: # If image is not the same size as the watermark, 
        watermark = watermark.resize((input_Image.width, input_Image.height)) # resizes the watermark to fit on the iamge

    input_Image.paste(watermark, (0, 0), watermark.convert('RGBA')) # Pastes the watermark on top of the image

    input_Image.save(output_folder+os.path.splitext(image)[0]+".png") # Saves the image to the 'output' subdirectory

    out_f_list += output_folder+os.path.splitext(image)[0]+".png\n"

if show_output:
    print("Output file list:")
    print(out_f_list)
if show_time: print("Task finished in " + str(round(time.time() - epoch_before, 2)) + "s") # Prints the time taken to complete the operation
pause_cls()
<filename>add_watermark.py
import time, os, argparse
from PIL import Image

parser = argparse.ArgumentParser(prog='add_watermark', 
                                description='Adds a watermark on top of images')

#parser.add_argument('-input', action='store', metavar='path', type=str, help='set a different input folder')
#parser.add_argument('-output', action='store',metavar='path', type=str, help='set a different output folder')
parser.add_argument('-sbs', action='store_true', help='adds a prompt after each step is completed')
parser.add_argument('-drw', action='store_true', help='resize watermark if input image size is different')
parser.add_argument('-dst', action='store_true', help='don\'t show time taken')
parser.add_argument('-si', action='store_true', help='show input file list')
parser.add_argument('-so', action='store_true', help='show output file list')

args = parser.parse_args()

input_folder = None #args.input
output_folder = None #args.output
dont_skip = args.sbs
resize_watermark = args.drw
show_time = args.dst
show_input = args.si
show_output = args.so

input_folder = input_folder+"\\" if input_folder != None else os.getcwd()+"\\input\\"
output_folder = output_folder+"\\" if output_folder != None else os.getcwd()+"\\output\\"
resize_watermark = False if resize_watermark else True
show_time = False if show_time else True

def pause_cls(): # Function that adds a "Press any button" prompt and then clears the screen
    global dont_skip
    print("\n", end="") # Prints a newline
    if (dont_skip):
        os.system("PAUSE")
        os.system("CLS")

os.system("COLOR 0F")
os.system("CLS")
print("Watermarker\nhttps://github.com/Lungu19")
pause_cls()

# Makes a list of all the files in the 'input' subdirectory
input_file_list = [f for f in os.listdir(input_folder) if os.path.isfile(os.path.join(input_folder, f))]

# Prints to the console the input file list
if show_input:
    print("Input file list:")
    for f in input_file_list:
        print(f + " ")

pause_cls()

watermark = Image.open("watermark.png") # Opens the watermark image
epoch_before = time.time()
out_f_list = ""

# Copies the watermark on top of each image
for image in input_file_list:
    input_Image = Image.open(input_folder+image) # Opens the image

    if (input_Image.width != watermark.width or input_Image.height != watermark.height) and resize_watermark: # If image is not the same size as the watermark, 
        watermark = watermark.resize((input_Image.width, input_Image.height)) # resizes the watermark to fit on the iamge

    input_Image.paste(watermark, (0, 0), watermark.convert('RGBA')) # Pastes the watermark on top of the image

    input_Image.save(output_folder+os.path.splitext(image)[0]+".png") # Saves the image to the 'output' subdirectory

    out_f_list += output_folder+os.path.splitext(image)[0]+".png\n"

if show_output:
    print("Output file list:")
    print(out_f_list)
if show_time: print("Task finished in " + str(round(time.time() - epoch_before, 2)) + "s") # Prints the time taken to complete the operation
pause_cls()
#parser.add_argument('-input', action='store', metavar='path', type=str, help='set a different input folder') #parser.add_argument('-output', action='store',metavar='path', type=str, help='set a different output folder') #args.input #args.output # Function that adds a "Press any button" prompt and then clears the screen # Prints a newline # Makes a list of all the files in the 'input' subdirectory # Prints to the console the input file list # Opens the watermark image # Copies the watermark on top of each image # Opens the image # If image is not the same size as the watermark, # resizes the watermark to fit on the iamge # Pastes the watermark on top of the image # Saves the image to the 'output' subdirectory # Prints the time taken to complete the operation