add landscape generation
This commit is contained in:
parent
55cb3e4e57
commit
555a0819e1
17
assm.py
17
assm.py
@ -10,6 +10,7 @@ def getDevicesList():
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
devicesList = getDevicesList()
|
devicesList = getDevicesList()
|
||||||
|
|
||||||
|
# portrait
|
||||||
for device in devicesList:
|
for device in devicesList:
|
||||||
device_w = devicesList[device][0]
|
device_w = devicesList[device][0]
|
||||||
device_h = devicesList[device][1]
|
device_h = devicesList[device][1]
|
||||||
@ -24,3 +25,19 @@ if __name__ == '__main__':
|
|||||||
base_image.paste(a, (image_w_center, image_h_center), a)
|
base_image.paste(a, (image_w_center, image_h_center), a)
|
||||||
base_image.save('./images/splash-portrait-{width}x{height}.png'.format(
|
base_image.save('./images/splash-portrait-{width}x{height}.png'.format(
|
||||||
width=device_w, height=device_h))
|
width=device_w, height=device_h))
|
||||||
|
|
||||||
|
# landscape
|
||||||
|
for device in devicesList:
|
||||||
|
device_w = devicesList[device][0]
|
||||||
|
device_h = devicesList[device][1]
|
||||||
|
device_r = round(device_w / 5)
|
||||||
|
|
||||||
|
image_w_center = round((device_w / 2) - (device_r / 2))
|
||||||
|
image_h_center = round((device_h / 2) - (device_r / 2))
|
||||||
|
|
||||||
|
base_image = Image.new('RGB', (device_h, device_w), (255, 255, 255))
|
||||||
|
logo_image = Image.open('./logo.png')
|
||||||
|
a = logo_image.resize((device_r, device_r))
|
||||||
|
base_image.paste(a, (image_h_center, image_w_center), a)
|
||||||
|
base_image.save('./images/splash-landscape-{height}x{width}.png'.format(
|
||||||
|
width=device_w, height=device_h))
|
||||||
|
Loading…
Reference in New Issue
Block a user