# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import subprocess
def create_banner_html():
return """
Control Any Android App with Autonomous AI
> Order an iced caramel latte with oat milk
✓
1. Open app & search catalog
✓
2. Select item & customize
Vision target grounded at (540, 1680)
○
4. Verify receipt & return
☕
Iced Caramel Latte
Double Shot · Oat Milk
$5.40
Delivery Address
Desk #42
"""
def render_image(html_str, output_path):
temp_html = f"/tmp/banner_{os.path.basename(output_path)}.html"
with open(temp_html, "w", encoding="utf-8") as f:
f.write(html_str)
cmd = [
"google-chrome",
"--headless=new",
"--disable-gpu",
"--virtual-time-budget=2000",
"--window-size=1280,480",
"--device-scale-factor=2",
"--hide-scrollbars",
f"--screenshot={output_path}",
f"file://{temp_html}",
]
res = subprocess.run(cmd, capture_output=True, text=True)
if os.path.exists(output_path):
print(f"Rendered {output_path} ({os.path.getsize(output_path)} bytes)")
else:
print(f"Error rendering {output_path}: {res.stderr}")
from pathlib import Path
assets_dir = Path(__file__).resolve().parent
os.makedirs(assets_dir, exist_ok=True)
html_content = create_banner_html()
# Generate main banner
render_image(html_content, str(assets_dir / "artemis-banner.png"))
# Also update en banner for consistency
render_image(html_content, str(assets_dir / "artemis-banner-en.png"))