# 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 """
Autonomous Real-time Testing, Exploration & Mobile Interaction System
Test Any Pixel / Android App with Autonomous AI
> Connect to Bluetooth earbuds, play a song, and capture CPU usage metrics
✓
1. Connect to Bluetooth earbuds
✓
2. Launch music player & play song
ADB polling top -n 1 (pid: 14208)
Target App CPU
4.2%
Bluetooth Audio
● Connected
Sample Rate
48kHz / A2DP
○
4. Assert CPU < 5.0% threshold
🎵
Coldplay - Yellow
Output: Pixel Buds Pro
Playing ▶
Active Audio Output Device
🎧 Pixel Buds Pro (A2DP)
"""
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"))