You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
439 B
Python
21 lines
439 B
Python
from PIL import Image
|
|
import PIL.ImageOps
|
|
import random
|
|
from random import randrange
|
|
|
|
#Random number
|
|
rotation = randrange(20)
|
|
|
|
#Random positive or negative
|
|
choice = random.choice(("+", "-"))
|
|
|
|
finalnumber = (str(choice) + str(rotation))
|
|
rotationinput = int(finalnumber)
|
|
|
|
#open both the watermark
|
|
logo = Image.open('watermark.png')
|
|
|
|
#rotate the watermark
|
|
rotatedlogo = logo.rotate(rotationinput, expand=True)
|
|
rotatedlogo.save('rotated.png')
|