Skip to content

Add Watermark and download button for generated images #12980

@ronitmaheshwari05

Description

@ronitmaheshwari05

Currently, the image generation Gradio app displays generated images but does not include a watermark or an easy option for users to download the images.

Adding a watermark and a download button would improve usability and help with attribution of generated content.

Expected Behavior
1. Generated images should automatically include a watermark (e.g., app name or logo) in a corner of the image.
2. A download button should be available so users can easily save the generated image to their device.

Possible Implementation
• Use PIL (Python Imaging Library) to overlay a watermark on the generated image before displaying it.
• Add a Gradio download button component below the generated image.

Example:

from PIL import Image, ImageDraw, ImageFont

def add_watermark(image):
draw = ImageDraw.Draw(image)
text = "Generated by AppName"
draw.text((10, image.height-30), text, fill=(255,255,255))
return image

Benefits
• Protects generated content with attribution
• Improves user experience
• Makes it easier for users to save images

Additional Context

This feature would be useful for projects using the Gradio interface for AI image generation tools.

I Would like to work on this feature if the maintainers approves it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions