From Blender Renders to Compose: Sprite Atlas and Layers
By Nesim Razon, independent mobile developer · 2026-11-30
The walking game I am building looks three dimensional but draws only flat images. Blender renders the pieces, a Python script packs them and Compose puts them together. This is the path from a render to a frame on screen, with the numbers that shaped it.

Two folders with different rules
The raw renders stay outside git. Today that folder is close to four hundred megabytes of PNG files, and it can be produced again from the Blender scripts. The folder that ships with the app is in the repository: about twenty one megabytes in under five hundred files.
One Python script connects them. It deletes the output folder and builds it again from the raw renders, which keeps it honest: nothing stays in the app that no longer has a source. The price is that a full run takes around twenty minutes on my machine, so a stopped run has to be restored from git.
Animation as an atlas
Each companion has four animations: idle, walking seen from behind, joy and sleep. Every animation is twenty four rendered frames. The script resizes each frame to 420 pixels and pastes them into one image, six columns by four rows.
In the game, drawing a frame means choosing a rectangle inside that image. The column is the frame number modulo six and the row is the frame number divided by six. There is one file to load per animation instead of twenty four.
The memory cost is the part to watch. An atlas of that size is 2520 by 1680 pixels, which is about seventeen megabytes once decoded, however small the file is on disk. So screens that show several companions at once use a second, smaller atlas of 260 pixel frames, and lists use a single thumbnail.
A scene in layers
A viewpoint is rendered as three separate images: far, middle and front. Between them the game draws other things. The object found at a stop sits on the middle layer, the companion walks in front of it, and the front leaves are drawn last, so the character really is inside the landscape.
The same viewpoint exists for morning and evening. The companion is not rendered twice: in the evening a colour matrix warms it by reducing green and blue a little.
Cheap depth
Layers also give a sense of depth when the phone tilts. The far layer moves a few pixels, the middle layer stays still and the front layer moves the most. The moving layers are drawn slightly larger than the screen so that no edge opens up.
The front layer also sways by under half a degree on a slow sine wave. It is a very small effect, and it is what makes a still picture feel like a place with air in it. To be honest about the tilt: on my own phone only the front layer visibly moves.
A layout file instead of guesses
The renderer knows where things are, so it writes that down. A small text file records, for a design area of 1080 by 2340, the box of each object, the ground point of each companion, and for every viewpoint a list of points along the path with their depth.
The size of the companion on screen follows from that depth and the focal length of the camera. Nothing is placed by eye in the app code. When a viewpoint is rendered again, the numbers come with it.
Cleaning renders before they ship
Raw renders need small repairs, and doing them in the script means they are never done by hand twice:
- Very faint pixels left by the shadow catcher are removed, so objects have no grey haze around them.
- Objects are cropped to their content, with one shared box for morning and evening so they do not jump.
- The ground line of each companion is measured from the first idle frame.
- Distant hills in the evening get a blue grey tint with a soft mask.
- Stickers for the journal get a white outline and a soft shadow, drawn with image filters.
Timing and the ground under the feet
Each animation has its own frame duration. Idle moves slowly, at 110 milliseconds a frame, walking and joy are quicker at 75, and sleep is the slowest at 160. The current frame is simply the elapsed time divided by that duration, wrapped around twenty four.
A rendered character has no contact shadow once it is cut out, so it can look as if it floats. The game draws a soft dark ellipse under the feet, a little under half as wide as the companion. It is one line of drawing code and it does more for the sense of weight than any extra frame.
The sky is not rendered at all. It is a vertical gradient drawn in code, with one pair of colours for the morning and another for the evening. A gradient costs almost nothing, while a rendered sky would be a large image for something with no detail.
Adding a new region
The game now has six regions. Each one has the same shape of data: three viewpoints in two times of day, three layers each, its own objects, a map and a few postcards. The path and the height of the ground are kept identical to the first region, so the layout numbers and the walking logic keep working.
That decision was the most useful one in the whole pipeline. A new region is mostly a new set of renders and an export step, not new code, and the tests complain if a picture or a text that a region needs is missing.
What I would keep
Everything is exported as WebP with transparency, with quality set per kind of image: a little lower for large backgrounds, higher for small objects that are looked at closely.
The approach suits a game where the camera never moves freely. It would be the wrong choice if players could rotate the world. Within that limit, a phone draws a handful of images per frame, and all the expensive lighting was paid for once, on my computer.
Frequently asked questions
What is a sprite atlas?
One image that holds many animation frames in a grid. The game draws one rectangle of it at a time.
Does a small file mean small memory use?
No. A decoded image uses memory according to its pixel size, usually four bytes per pixel.
How do 2D layers create depth?
By moving the near layer more than the far one when the view shifts, and by drawing characters between layers.
Why generate the layout file from the renderer?
So that positions stay correct when a scene is rendered again, without editing numbers in the app by hand.
More from the blog
- What Stays Platform-Specific in a Kotlin Multiplatform App
- Declaring a Walking Game's Health Data in Play Console
- Blender From the Command Line: Pale Colours and Boolean Order
- Play Games Saved Games: A Merge That Never Goes Backwards
- A Four-Language Static Site in Python: hreflang and Sitemap
- A Preflight Script for iOS Builds: Save Cloud Mac Minutes