Project_WL/AgentScripts/WL814x4_report.py

46 lines
2.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import numpy as np
from PIL import Image, ImageDraw
RAW='Screenshots_WL/WL814x/4th/raw'; OUT='Screenshots_WL/WL814x/4th'
import os; os.makedirs(OUT,exist_ok=True)
ma=np.asarray(Image.open(RAW+'/mask_all.png').convert('L'))>127
mf=np.asarray(Image.open(RAW+'/mask_Face.png').convert('L'))>127
ys,xs=np.where(ma|mf); x0,x1,y0,y1=xs.min()-24,xs.max()+25,ys.min()-24,ys.max()+25
def crop(n,s=1.0):
im=Image.open(RAW+'/'+n+'.png').convert('RGB').crop((x0,y0,x1,y1))
return im.resize((int(im.width*s),int(im.height*s)),Image.NEAREST) if s!=1.0 else im
def grid(out,items,fn):
ims=[(t,fn(n)) for t,n in items]
W=sum(i.width for _,i in ims)+18*(len(ims)-1); H=ims[0][1].height+26
o=Image.new('RGB',(W,H),(22,22,26)); d=ImageDraw.Draw(o); x=0
for t,im in ims:
o.paste(im,(x,26)); d.text((x+3,7),t,fill=(240,232,190)); x+=im.width+18
o.save(OUT+'/'+out); print('saved',out,o.size)
grid('e_final_close.png',[('3차 상태 (4차 시작)','a_now'),('4차 최종 (부위별 색조 보정)','fin')],lambda n:crop(n))
grid('e_shadow_steps.png',[('지금 G0.58','a_now'),('G0.75','b_g075'),('G0.85','c_g085'),('G0.95','d_g095'),('G.95 B1.0','f_g095b100'),('거의 중성','g_neutral')],lambda n:crop(n,0.55))
def wide(n,s=0.42):
im=Image.open(RAW+'/'+n+'.png').convert('RGB'); return im.resize((int(im.width*s),int(im.height*s)),Image.BILINEAR)
grid('e_final_wide.png',[('3차 상태','wide_a_now'),('4차 최종','fin_wide'),('참고: 그레이딩 G0.95','wide_d_g095')],wide)
rows=[('항목','1차 시작(원본 텍스처)','4차 최종','합격선','판정'),
('서로 다른 색 비율','89.3 %','3.9 %','≤ 25 %','PASS'),
('캐릭터 영역 고유색','2,676','115','≤ 200','PASS'),
('부위(덩어리)당 색 단계','41','평균 2.8 (13/14칸이 2~3)','≤ 4','PASS'),
('눈이 어두운 덩어리로','10 px','36 px (눈 1개 7×5)','36 px 이상','PASS'),
('화면 Hue 오차(유채 가중)','','10.7° (벨트칸 제외 8.4°)','≤ 8°','거의'),
(' 부위 최대','','벨트 61.1° / 그 외 ≤ 28.8°','≤ 20°','미달 2칸'),
('실루엣 외곽선','1 px','1 px (설정 무변경)','유지','PASS'),
('배경 룩','PD 승인','무변경(그레이딩 미채택)','유지','PASS')]
cw=[210,170,220,90,80]; rh=32; W=sum(cw)+40; H=rh*len(rows)+64
img=Image.new('RGB',(W,H),(22,22,26)); d=ImageDraw.Draw(img)
d.text((20,12),'WL-814x 1~4차 최종 요약 (인게임 Play · 포스트 포함 · 게임 크기 · 캐릭터 2,959 px)',fill=(255,235,160))
for r,row in enumerate(rows):
y=44+r*rh
bg=(40,40,48) if r==0 else ((30,30,36) if r%2 else (26,26,31))
d.rectangle([16,y,W-16,y+rh-2],fill=bg)
x=20
for c,cell in enumerate(row):
col=(235,235,235)
if r>0 and c==4: col=(130,230,150) if cell=='PASS' else (245,200,120)
if r>0 and c==2: col=(150,210,255)
d.text((x+6,y+8),str(cell),fill=col); x+=cw[c]
img.save(OUT+'/e_metrics.png'); print('saved e_metrics.png',img.size)