I have a script. I want to modify the script slightly. I want to upload logo instead of just one. One will remain same as before and other want to put top left corner of photos as watermark. Here is my script= # Install necessary libraries
!pip install pillow ipywidgets

from PIL import Image, ImageEnhance
from IPython.display import display, clear_output
import ipywidgets as widgets
from ipywidgets import interact
from google.colab import drive
from google.colab import files
import zipfile
import os

# Mount Google Drive
drive.mount('/content/drive')

# Function to select file from Google Drive
def select_file_from_drive(description):
    print('Select the file from your Google Drive')
    uploaded = files.upload()
    filename = list(uploaded.keys())[0]
    return filename

# Function to apply watermark
def apply_watermark(image, watermark, opacity, scale_factor, flip):
    # Optionally flip the image horizontally
    if flip:
        image = image.transpose(method=Image.FLIP_LEFT_RIGHT)

    # Resize the watermark
    w_width = int(image.width * scale_factor)
    w_height = int(watermark.height * (w_width / watermark.width))
    resized_watermark = watermark.resize((w_width, w_height), Image.LANCZOS)

    # Ensure watermark has RGBA mode for transparency
    if resized_watermark.mode != 'RGBA':
        resized_watermark = resized_watermark.convert('RGBA')

    # Adjust opacity
    alpha = resized_watermark.split()[3]
    alpha = ImageEnhance.Brightness(alpha).enhance(opacity)
    resized_watermark.putalpha(alpha)

    # Position the watermark at the bottom center
    wm_position = ((image.width - resized_watermark.width) // 2,
                   image.height - resized_watermark.height - 10)  # 10 px from bottom

    # Paste the watermark onto the image
    transparent_image = Image.new('RGBA', image.size)
    transparent_image.paste(image, (0, 0))
    transparent_image.paste(resized_watermark, wm_position, mask=resized_watermark)
    return transparent_image

# Function to upload watermark image
def upload_watermark():
    print("Upload your watermark logo image:")
    uploaded = files.upload()
    watermark_path = list(uploaded.keys())[0]
    watermark_img = Image.open(watermark_path).convert("RGBA")
    return watermark_img

# Upload watermark image
watermark_img = upload_watermark()

# Select and extract ZIP file from Google Drive
zip_file_name = select_file_from_drive('Select your ZIP file:')
zip_path = f'/content/{zip_file_name}'
upload_folder = '/content/input_images'
os.makedirs(upload_folder, exist_ok=True)

with zipfile.ZipFile(zip_path, 'r') as zip_ref:
    zip_ref.extractall(upload_folder)

# Get the list of image filenames
image_files = [f for f in os.listdir(upload_folder) if os.path.isfile(os.path.join(upload_folder, f))]

# Use the first image for preview
first_image_path = os.path.join(upload_folder, image_files[0])

# Define widgets for user input
slider_opacity = widgets.FloatSlider(value=0.5, min=0.0, max=1.0, step=0.1, description='Opacity:')
slider_scale = widgets.FloatSlider(value=0.2, min=0.1, max=0.5, step=0.05, description='Scale:')
toggle_flip = widgets.Checkbox(value=False, description='Flip Horizontally')

# Preview function
def preview(opacity, scale_factor, flip):
    with Image.open(first_image_path) as sample_image:
        sample_image = sample_image.convert("RGBA")
        result = apply_watermark(sample_image, watermark_img, opacity, scale_factor, flip)
        clear_output(wait=True)
        display(result)

# Interactive preview
interact(preview, opacity=slider_opacity, scale_factor=slider_scale, flip=toggle_flip)

# Directory for output images
output_folder = '/content/output_images'
os.makedirs(output_folder, exist_ok=True)

# Function to process all images
def process_images(opacity, scale_factor, flip):
    output_files = []
    for filename in image_files:
        input_image_path = os.path.join(upload_folder, filename)
        with Image.open(input_image_path) as img:
            img = img.convert("RGBA")
            watermarked_image = apply_watermark(img, watermark_img, opacity, scale_factor, flip)
            output_path = os.path.join(output_folder, filename)
            watermarked_image.save(output_path, "PNG")
            output_files.append(output_path)

    # Prepare ZIP file
    drive_output_zip = '/content/drive/My Drive/processed_images.zip'
    with zipfile.ZipFile(drive_output_zip, 'w') as zipf:
        for file in output_files:
            zipf.write(file, arcname=os.path.basename(file))

    print("Processed images are saved back to Google Drive.")

# Button to start processing images
confirm_button = widgets.Button(description="Batch Process Images")
confirm_button.on_click(lambda x: process_images(slider_opacity.value, slider_scale.value, toggle_flip.value))

# Display button
display(confirm_button)