
January 15, 2026
Building real-time, animated maps in pure Ruby — no JavaScript required.
A new class of maps for Ruby
Over the past weeks, we’ve been extending ruby-libgd and libgd-gis far beyond static image rendering. What started as a raster + GIS toolkit is now evolving into something much bigger:
An animated map engine, written entirely in Ruby.
This new engine allows Ruby applications to render basemaps, draw vector layers, place dynamic sprites, and generate frame-by-frame animations — all from the backend.
No browser. No WebGL. No JavaScript.
Just Ruby.
How animation works at the lowest level
At its core, the system is built on primitive frame rendering using ruby-libgd.
A simple animated object can be produced with nothing more than an image buffer and a loop:
gif = GD::Gif.new("bounce.gif")60.times do img = GD::Image.new(W, H) # background black = GD::Color.rgb(0,0,0) img.filled_rectangle(0,0,W,H, black) # bounce against walls if x - r <= 0 || x + r >= W vx = -vx end if y - r <= 0 || y + r >= H vy = -vy end x += vx y += vy # color depends on speed speed = Math.sqrt(vx*vx + vy*vy) color = GD::Color.rgb( 100 + speed * 20, 180, 255 - speed * 20 ) img.filled_ellipse(x, y, r*2, r*2, color) gif.add_frame(img, delay: 5)end

This is the same model used for map animation — except instead of circles, we render geographic layers.
Each frame is a full GIS composition.
From pixels to geospatial animation
On top of this low-level renderer, libgd-gis adds geographic intelligence:
- projections
- layers
- routes
- basemaps
- moving objects
A typical animated map frame loop looks like this:
frames.times do |i| t = i.to_f / (frames - 1) car_layer.data = [{ "geometry" => { "coordinates" => car.point_at(t) }}] plane_layer.data = [{ "geometry" => { "coordinates" => plane.point_at(t) }}] img = map.render_with_base draw_legend(img) gif.add_frame(img, delay: 5)end
Here we interpolate real geographic paths and render them into successive frames.
This is how cars, planes, ships, routes, and sensors can be animated across a real map.
What the engine can already do
The current alpha implementation already supports:
- Real basemaps (Carto / OpenStreetMap tiles)
- Light & Dark themes
- Vector layers (streets, rivers, polygons, routes)
- Sprites and markers (cars, buildings, POIs)
- Frame-based animation rendering
Everything you see in the demo animation was rendered by Ruby — frame by frame.

Why this matters
Most modern map animation stacks depend on:
- JavaScript
- WebGL
- Canvas
- frontend frameworks
This engine is different.
It runs entirely on the backend.
That enables:
- batch rendering
- server-side pipelines
- scheduled map generation
- automated visual reporting
- GIS-driven motion graphics
Ruby becomes not just a web language — but a visual computation engine.
Current status: Alpha Preview
The animated map engine is currently available as an alpha development branch while we prepare the upcoming releases:
- ruby-libgd 0.2.3
- libgd-gis (next release)
The animation pipeline is real, working, and already producing output — but APIs are still being refined.
What comes next
Upcoming work includes:
- timeline-based animation
- camera movement & zoom
- label animation
- multi-layer motion
- video export
The goal is to make Ruby a first-class platform for geospatial animation and visual storytelling.
Explore the projects
- ruby-libgd https://github.com/ggerman/ruby-libgd https://rubygems.org/gems/ruby-libgd
- libgd-gis https://github.com/ggerman/libgd-gis https://rubygems.org/gems/libgd-gis
All previews and updates will continue to be published here on RubyStackNews.
