← Nesim Apps

Blender From the Command Line: Pale Colours and Boolean Order

By Nesim Razon, independent mobile developer · 2026-12-05

#Dev notes#Game design

I make the art for my games with Blender scripts that run without opening the program. It is fast and repeatable, but a few things behave differently from the screen you see when you work by hand. These are the traps I hit, with the fixes that are now in my scripts: washed-out colours, a toon look built from nodes, a boolean that ignores order and the habit of keeping sprite sets in versions.

The setup: a script, a background run, a PNG

Blender 5.3 runs from the command line in background mode with a script, so a single command builds the whole scene and renders it. Every script starts from factory settings with an empty scene, so nothing from a previous session leaks in. On my machine a 768 pixel transparent PNG of a single piece takes about seven seconds with the CPU path tracer, which makes it practical to re-render a whole set after a change.

The reason to script is repeatability. Colours, camera, lights and sizes are numbers in a file under version control, so a tweak is a one-line change and every asset in a set stays consistent. The cost is that you only see the result after the render, which is where the first trap lives.

Trap 1: the colours come out pale

My first renders looked washed out compared with the colours I had set. The cause was the view transform. In Blender 5 the default is a filmic style transform that compresses highlights and lowers saturation, which is nice for photorealism and wrong for flat game art where a green material should look like the green you picked.

The fix is one line in the script: set the scene view transform to Standard. I put it right after resetting to factory settings in every render script, because the setting belongs to the scene and a freshly reset scene starts with the default again.

Trap 2: a boolean union that needs the right place in the stack

To make a tic-tac-toe cross from two bars without a seam where they cross, I join them with a boolean union modifier. The trap is the order. A modifier stack runs from top to bottom and a new modifier is added at the end, so the boolean would run after the bevel and the subdivision, on geometry that is already smoothed. I want it between the two.

The fix has three parts. The union modifier uses the exact solver. The object that owns the modifier must be the active object. Then the modifier is moved to the position I want, here index one, with the operator that moves a modifier to an index. The second bar is hidden from both the viewport and the render, so only the joined result is visible. The order of the stack is part of the design, so I write it down in a comment next to the code: bevel, boolean union, subdivision.

Trap 3: a toon look from nodes

For the planets in one game I wanted a printed, flat look with three tones instead of realistic shading. The recipe is a chain of nodes. The shader output goes into a Shader to RGB node, which turns the lit result into a plain colour. A conversion to black and white gives a single brightness value. A colour ramp with constant interpolation and three stops maps that brightness to three fixed greys, around fifty, seventy-six and one hundred percent. The result is multiplied with the material colour and sent to an emission shader as the surface.

This works with the real-time render engine, which is what that script uses, and the toon look is switched by an environment variable so the same script can still produce the older realistic version. That switch saved me when I wanted to compare the two on a phone.

Keep sprite sets in versions

My pipe puzzle's sprites went through four script versions. The first set was playable but players described the colours and characters as lifeless, so the second version used richer colours. The third added a rain cloud source piece, and the fourth added hexagonal tiles with clay bases and curved pipe pieces. Each version is a separate script, so I can still re-render the old set to compare.

Versioned scripts also make it safe to experiment. The post-processing step runs over everything, and a preview sheet is generated each time, so a bad idea costs a few minutes and nothing else.

A checklist for scripted rendering

Frequently asked questions

Why do my Blender script renders look pale?

The default view transform in recent versions compresses colour. Set the scene view transform to Standard for flat, accurate colours.

Why does my boolean modifier give the wrong shape?

Modifiers run in stack order. Move the boolean to the position you need and make its owner the active object first.

How do I get a toon look in Blender?

Pass the shader through Shader to RGB, convert to brightness, map it with a constant colour ramp to a few tones and use the result as an emission colour.

Can I run Blender without opening it?

Yes. Run it in background mode with a Python script, and it builds and renders the scene by itself.

Why keep old versions of the sprite scripts?

They let you re-render an older set to compare it with a new one and make experiments safe.

More from the blog