forked from unimatrix/web
16 lines
966 B
Python
16 lines
966 B
Python
"""Crop the existing shared account portrait atlas, not individual quest artwork."""
|
|
from pathlib import Path
|
|
from PIL import Image
|
|
|
|
root=Path(__file__).resolve().parents[1]
|
|
atlas=Image.open(root/'website/web/assets/mentat-portraits-atlas-v1.png').convert('RGBA')
|
|
out=root/'DuneRealmsGUI/src/main/resources/mcgui-npc-avatars'
|
|
out.mkdir(parents=True,exist_ok=True)
|
|
width,height=atlas.size
|
|
for i in range(8):
|
|
x,y=i%4,i//4
|
|
cell=atlas.crop((x*width//4,y*height//2,(x+1)*width//4,(y+1)*height//2))
|
|
cell.thumbnail((256,256))
|
|
cell.save(out/f'npc_avatar_{i}.png',optimize=True)
|
|
for key,source in {'caladan':'caladan.webp','giedi_prime':'giedi.webp','kaitain':'kaitain.webp','sigma_draconis_iv':'sigma.webp','arrakis':'arrakis.webp','guild_lobby':'guild.webp','imperial':'progression/imperial-court.webp'}.items():
|
|
art=Image.open(root/'website/web/assets'/source).convert('RGB');art.thumbnail((600,300));art.save(out/f'npc_world_{key}.png',optimize=True)
|

Staff