"""Narrow the still-image privacy mask to the environment identity line.
Use original root screenshots after the driver's two-identical-frames check.
Usage: sanitize-captures.py RUN_DIRECTORY SIDE
"""
import pathlib,subprocess,sys
run=pathlib.Path(sys.argv[1]);side=sys.argv[2]
for i in [2,3,8]:
    subprocess.run(['convert',str(run/f'{side}-{i}-raw-b.png'),'-fill','#fafafa','-draw','rectangle 1000,175 1840,205','-fill','#666666','-font','DejaVu-Sans','-pointsize','13','-annotate','+1020+193','Environment identity redacted',str(run/f'{side}-{i}-public.png')],check=True)
