import base64
import subprocess
from pathlib import Path
OUT = Path(__file__).resolve().parent
WIDTH, HEIGHT = 2048, 768
BLUE = "#07527b"
ORANGE = "#ed8208"
YELLOW = "#fff2a6"
def orange_icon(cx, cy, scale=1.0):
return f'''
'''
def text(x, y, value, size, fill=BLUE, weight=700, family="Arial, sans-serif", spacing=0):
return (f'{value}')
base64_image = base64.b64encode((OUT / "decorative_base_cutout.png").read_bytes()).decode("ascii")
parts = [f'''',
])
svg_path = OUT / "orange_juice_wrap.svg"
svg_path.write_text("\n".join(parts), encoding="utf-8")
subprocess.run(["sips", "-s", "format", "png", str(svg_path), "--out", str(OUT / "orange_juice_wrap.png")], check=True)
subprocess.run([
"ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", str(OUT / "orange_juice_wrap.png"),
"-vf", "crop=960:768:544:0", "-frames:v", "1", str(OUT / "orange_juice_front.png"),
], check=True)
print(OUT / "orange_juice_wrap.svg")
print(OUT / "orange_juice_wrap.png")
print(OUT / "orange_juice_front.png")