python - <<'PY'
from PIL import Image
import json
s='HH-7158';b=json.load(open('/workspace/scratch/detailboxes.json'))[s];a=Image.open('/workspace/input/photos/'+s+'.tif');m=Image.open('/workspace/scratch/finalmasks/'+s+'.png');o=Image.new('RGB',a.size,(108,125,48));o.paste(a,(0,0),m);x0,y0,x1,y1=b
r=(x0+800,y0+830,x0+1300,y0+1180)
a.crop(r).save('/workspace/scratch/yeti_original.png');o.crop(r).save('/workspace/scratch/yeti_cut.png')
PY