Skip to content

JCEleanor/watermark-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watermark-Generator

Overview

A watermark generator built with Python and Pillow, which allows users to add watermark in the following positions:

example

The program will first shrink the watermark 10x based on the input image's orientation.

The math for each position is as below:


1. upper left
watermark_position = (0, 0)

2. upper right
watermark_position = (input_width - logo_width, 0)

3. bottom right
watermark_position = (input_width - logo_width, input_height - logo_height)

4. bottom left
watermark_position = (0, input_height - logo_height)

5. center
watermark_position = (input_width // 2, input_height // 2)

According to Cartesian pixel coordinate system, the origin (0, 0), is at the top left cornor, while the center of the watermark will actually be at (0.5, 0.5).

Requirements

Pillow:

pip install pillow

Pillow Doc

Examples of Use

  • Landscape

example

  • Profile

example

  • Square

example

Future Improvement

  • Intergrate Graphical User Interface such as Tkinter to improve user experience.
  • Add more flexibility to watermark position.
  • Revamp error handling to make it more foolproof.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published