[Python] Quick Watermark Example with PIL

I created captcha sample long time ago but this time, it’s much simple example. If you would like to generate images with your logo, it’s only few lines of code in PIL.

import Image
baseim = Image.open(“original.png”)
logoim = Image.open(“logo.png”) #transparent image

Important thing is the 3rd argument of the paste function. You can specify your PNG as alpha also so that you avoid black background.

here is the original image

and this is the logo

then this is the image after watermarking

python, image

By: kiichi on: