Building Ambient Art for Samsung Frame TVs Without the Subscription Tax
Hook
The most interesting thing about sf-city isn't that it renders San Francisco as infinite parallax art—it's that the entire WebGL renderer has zero npm dependencies and validates itself through headless screenshots before every deployment.
Context
Samsung's Frame TV is expensive wall art that moonlights as a television. The official Art Store charges $5/month for rotating artwork, which feels absurd when you're already staring at a $1,500 display. Third-party alternatives exist, but they're either cloud-dependent screensavers, static image players, or Processing sketches exported to video loops that require re-rendering for every edit.
The sf-city project tackles a specific itch: creating persistent, editable ambient art that runs directly on the TV's Tizen operating system without subscriptions, cloud dependencies, or framework bloat. It's an illustrated cityscape—ships, ferries, clouds, buildings—that scrolls infinitely at whatever speed you configure. The entire stack is vanilla JavaScript for the renderer, Python for build orchestration, and JSON for scene composition. This isn't trying to be a general-purpose art framework; it's optimized for the exact constraints of rendering long-running, low-FPS animations on resource-constrained TV hardware.
Technical Insight
The architecture splits into three deliberately isolated layers: a browser-based editor for scene composition, a headless validation pipeline, and a Tizen widget packager. The renderer itself is a custom scene graph with depth-sorted layers, procedural parallax motion, and shared tick scheduling that drives both development and production environments.
Here's the declarative scene format that makes the editor work:
{
"objects": [
{
"id": "ferry_01",
"layer": 3,
"sprite": "assets/ferry.png",
"position": {"x": 1200, "y": 450},
"motion": {
"velocity": -0.8,
"direction": "left",
"reflection": "none"
},
"depth": 0.6
},
{
"id": "cloud_layer",
"layer": 1,
"sprite": "assets/clouds_02.png",
"position": {"x": 0, "y": 80},
"motion": {
"velocity": -0.2,
"parallax": 0.3
},
"depth": 0.1
}
],
"atmosphere": {
"palette": "golden_hour",
"fog_density": 0.15
}
}
The clever bit is separating artwork travel direction from visual reflection. Ships move right-to-left (direction: "left") while hull text renders correctly (reflection: "none"), solving the mirrored sprite problem without runtime compositing. The renderer just flips the sprite's draw direction based on motion, not appearance.
Depth sorting happens once during scene load, not per-frame. Objects with lower depth values render first, creating atmospheric layering without z-buffer complexity. The tick system is time-based, not frame-locked:
let lastFrame = performance.now();
function tick(currentTime) {
const delta = currentTime - lastFrame;
lastFrame = currentTime;
objects.forEach(obj => {
obj.position.x += obj.motion.velocity * delta * 0.016; // normalize to ~60fps baseline
if (obj.position.x < -obj.width) {
obj.position.x = canvas.width; // wrap for infinite scroll
}
});
render();
requestAnimationFrame(tick);
}
This gracefully degrades on slower hardware—animations slow down proportionally rather than stuttering. The README reports 7-17fps on the 2022 Frame TV, which is fine for ambient art where motion blur and perceived smoothness matter more than frame count.
The Python build pipeline is where things get interesting. Before packaging the Tizen widget, it runs Playwright to generate validation screenshots:
# Simplified from the actual tooling
def validate_scene(scene_path):
browser = playwright.chromium.launch(headless=True)
page = browser.new_page(viewport={'width': 1920, 'height': 1080})
page.goto(f'file://{scene_path}/editor.html')
page.wait_for_selector('canvas')
page.screenshot(path='validation.png')
browser.close()
return 'validation.png'
You see exactly what will render on the TV before committing to the signing ceremony. This is visual regression testing baked into deployment—if clouds are clipping or ships are misaligned, you catch it before installation.
The rollback command is particularly clever: it rebuilds the previous scene JSON with the current renderer code. This means bugfixes to the rendering engine propagate to old scenes without reverting functional improvements. It's content rollback with forward compatibility, not binary versioning.
Atmospheric effects like fog and color grading are procedurally baked during build, not applied at runtime. The golden_hour palette pre-multiplies colors into sprite assets rather than compositing filters per-frame, trading build-time processing for runtime simplicity. On TV hardware where GPU access is limited and JavaScript engines are older, this matters enormously.
Gotcha
The deployment path is where idealism meets Samsung's walled garden. The project includes a 'local deployment adapter' that's explicitly private and not included in the repository. This is likely device-specific ADB tooling or wrapper scripts around Samsung's certificate generation flow, which varies wildly between Tizen versions and requires a Samsung developer account. Without this adapter, you're manually generating certificates, signing the widget, and sideloading via USB—doable but tedious enough to kill momentum.
Performance is locked to one tested configuration: a 2022 Frame TV running Tizen 6.5 at 1600×900 resolution. The 7fps measurement during rapid travel suggests older models or 4K displays would struggle, and there's no fallback rendering path. The single-canvas architecture with manual depth sorting means adding interactive features—clickable buildings, time-of-day scrubbing, dynamic weather—would require spatial indexing or raycasting that doesn't exist. This renders a predetermined composition at fixed performance; it's not an interactive application framework. If you want real-time transit data or weather-reactive art, you're rewriting the entire renderer.
Verdict
Use if you already own a Samsung Frame TV, despise subscription fees, and want obsessive control over long-running ambient art without cloud dependencies or telemetry. The vanilla JavaScript approach avoids Tizen's finicky Node runtime, the validation pipeline catches visual bugs before installation, and the scene format is simple enough to hand-edit. This shines for curated, locally controlled art on specific hardware you already own. Skip if you lack physical access to a compatible Samsung TV, need 'just works' deployment (the certificate signing ceremony is genuinely tedious), or want dynamic data integration—this renders fixed compositions, not interactive visualizations. Also skip if you're targeting non-Samsung hardware; a Raspberry Pi with Chromium kiosk mode playing the editor HTML directly is simpler and cheaper. Use Mapbox GL for actual transit visualization or Electric Objects/Meural Canvas if you want curated galleries without deployment complexity.