diff options
author | 2019-05-11 04:51:30 +1000 | |
---|---|---|
committer | 2019-05-11 04:51:30 +1000 | |
commit | 0e2c6a1b0daef5b569da7652801b5725bf1ed95b (patch) | |
tree | c3d57e50f2ba07cb2d9e7476d3b9441c1f671bd9 /bot/utils/halloween/spookifications.py | |
parent | not importing aiohttp now (diff) | |
parent | Merge pull request #198 from Suhail6inkling/constants_fix (diff) |
Merge branch 'master' into hanukkah_embed_iceman
Diffstat (limited to 'bot/utils/halloween/spookifications.py')
-rw-r--r-- | bot/utils/halloween/spookifications.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/bot/utils/halloween/spookifications.py b/bot/utils/halloween/spookifications.py index 5f2369ae..390cfa49 100644 --- a/bot/utils/halloween/spookifications.py +++ b/bot/utils/halloween/spookifications.py @@ -8,17 +8,20 @@ log = logging.getLogger() def inversion(im): - """Inverts an image. + """ + Inverts the image. Returns an inverted image when supplied with an Image object. """ + im = im.convert('RGB') inv = ImageOps.invert(im) return inv def pentagram(im): - """Adds pentagram to image.""" + """Adds pentagram to the image.""" + im = im.convert('RGB') wt, ht = im.size penta = Image.open('bot/resources/halloween/bloody-pentagram.png') @@ -28,10 +31,13 @@ def pentagram(im): def bat(im): - """Adds a bat silhoutte to the image. + """ + Adds a bat silhoutte to the image. + + The bat silhoutte is of a size at least one-fifths that of the original image and may be rotated + up to 90 degrees anti-clockwise. + """ - The bat silhoutte is of a size at least one-fifths that of the original - image and may be rotated upto 90 degrees anti-clockwise.""" im = im.convert('RGB') wt, ht = im.size bat = Image.open('bot/resources/halloween/bat-clipart.png') @@ -49,6 +55,7 @@ def bat(im): def get_random_effect(im): """Randomly selects and applies an effect.""" + effects = [inversion, pentagram, bat] effect = choice(effects) log.info("Spookyavatar's chosen effect: " + effect.__name__) |