mirror of
https://github.com/e1ven/Robohash.git
synced 2025-06-23 21:35:02 +00:00
flatten after bgset
This commit is contained in:
parent
8cd881354f
commit
6c797b0f47
@ -183,18 +183,18 @@ class Robohash(object):
|
||||
img = img.resize((1024,1024))
|
||||
roboimg.paste(img,(0,0),img)
|
||||
|
||||
# If we're a BMP, flatten the image.
|
||||
if format == 'bmp':
|
||||
#Flatten bmps
|
||||
r, g, b, a = roboimg.split()
|
||||
roboimg = Image.merge("RGB", (r, g, b))
|
||||
|
||||
if bgset is not None:
|
||||
bg = Image.open(background)
|
||||
bg = bg.resize((1024,1024))
|
||||
bg.paste(roboimg,(0,0),roboimg)
|
||||
roboimg = bg
|
||||
|
||||
# If we're a BMP, flatten the image.
|
||||
if format in ['bmp','jpeg']:
|
||||
#Flatten bmps
|
||||
r, g, b, a = roboimg.split()
|
||||
roboimg = Image.merge("RGB", (r, g, b))
|
||||
|
||||
self.img = roboimg.resize((sizex,sizey),Image.ANTIALIAS)
|
||||
self.format = format
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user