AI Game Art in One Style: A Pixel Art Build in Godot
The version of this game we were ready to publish matched on every measure we had: one art style, every picture converted to fit one 320 x 180 screen, one palette of 32 colors. The same cut showed a fresh run of the hero's prompt in the app, and the review compared the two moles:
"These ones actually look better than the one you used for the game."
"Now I get why the character doesn't look as nice as the generated ones."
"Overall, I think the characters should dictate the pixel size so that they look great."Miguel, from our team: three notes from one review
He was right. We had sized the hero to fit the screen. It should have been the other way round, and the rebuild that followed is this post: one small game, a mole called Bix in a crystal mine, with its prompts, measurements and what it cost in Ludo credits.
How do you keep AI pixel art consistent in a game?
To keep AI-generated game art in one style, lock three things in order: one art style, one pixel size and one color palette. One art style: pick a hero picture, then make every other asset with the same Art Style setting and the same style words at the end of the prompt. One pixel size: let the hero's pixels set the size of a game pixel, and put every other picture on that grid. One color palette: recolor the whole set to one short list of colors, starting from the hero's. In Bix's mine that was Ludo's 16-Bit Pixel style, a 640 x 360 screen and 48 colors.
For the first lock in full, see consistent game art style with AI and the guide how to keep a consistent art style across AI game assets. This post is one build, and spends most of its time on the other two.
Why AI game art looks mismatched
Each picture is made on its own, and nothing tells one request what the last one looked like, so the look has to be something you carry from prompt to prompt. Our general guide to using AI-generated art in your games covers the wider workflow.
One art style for every asset: an anchor picture and one line of style words
Everything hangs on one picture. Ours is Bix, a Sprite made in the Image Generator with the Art Style on 16-Bit Pixel and the Perspective on Side-Scroll. His prompt ends with the style words, and so does every prompt after it: "16-bit pixel art, limited palette, warm amber, rust red and deep teal palette, dark outlines".
For the other seven assets the Art Style and the style words stay, and only the subject and the image type change: two enemies and a mine cart as Sprites, a heart as a UI Element, a gem as an Item Icon, the ground as a Horizontal Tiling Sprite and the cave as a Horizontal Background.
Do you need a style reference for every asset? We made all seven assets both ways, with the Art Style and the words, and in Generate with Style with a hero as the reference image. In 16-Bit Pixel the sprites matched the hero's palette equally well either way; the ones made from the reference were closer in lightness (a gap of 5.1 against 10.0), and backgrounds came back closer to the hero's light and saturation. So the cave is a Generate with Style picture, made from our first hero pick, and the other seven are not.
Two tips from the enemies. State the facing in the prompt: we asked for the bat "seen from the side in profile, flying toward the left" and all eight results came back that way. And check an enemy against the ground it walks on. Contrast ratio is how much lighter one thing is than another, where 1 to 1 is no difference: one Edit Image pass ("make the beetle's shell bright icy cyan crystal... keep its shape, pose and dark outlines") took the beetle from 1.57 to 1 against the cave to 2.02 to 1.
One pixel size: let the hero set the game pixel
Pixel art is drawn in blocks: squares of several file pixels that act as one pixel of the art. A picture has a clean grid when every block is the same size and they all line up. Ludo's 16-Bit Pixel style gives every picture a clean grid sized for that picture. We measured the files: 6 pixel blocks on Bix, the bat and the cart, 8 on the ground, 12 on the heart and the gem.
A game pixel is the smallest square the game draws, and every block of every picture should be exactly one. Pixel artists call the alternative mixels, mixed pixel sizes on one screen, and the cure is the usual one: snap every picture to one grid, scale only with nearest neighbor, and leave the rest to integer scaling in the engine.
The question is which grid. We first picked the screen, 320 x 180, and converted every picture to fit, the hero included. The rebuild picked the hero. Bix is 768 pixels across on 6 pixel blocks, so 128 game pixels, and the screen where that looks right is 640 x 360. A picture already on a clean grid just shrinks by its block size, with the free Ludo toolbox:
$ ludo toolbox image scale bix.png --by 1/6
{"image":"ludo-output/bix.png","width":128,"height":128,"scale":"1/6"}We checked it: scaled back up six times, the 128 pixel Bix differs from the generation in 0 pixels. The hero in the game is the hero Ludo drew.
Everything else follows him. Clean grids shrink by their own block size. Where a picture should come out at a different size, Convert to Pixel Art does it, and its Pixel Size is how many pixels of the picture become one game pixel. The cart has 6 pixel blocks like Bix, and we converted it at 12 to size it to the set: half as large each way, 63 x 64.
| Asset | How it got onto Bix's grid | Size in the game |
|---|---|---|
| Bix (hero) and the bat | Ludo toolbox, scale by 1/6 | 128 x 128 |
| Heart and gem | Ludo toolbox, scale by 1/12 | 64 x 64 |
| Ground | Ludo toolbox, scale by 1/8 | 196 x 80 |
| Mine cart | Ludo Convert to Pixel Art, 12 px | 63 x 64 |
| Beetle | Ludo Convert to Pixel Art, 12 px | 63 x 63 |
| Cave | Ludo Convert to Pixel Art, sized to fill the screen's height | 884 x 359 |
If you are still choosing a generator for this kind of art, we keep a comparison of AI pixel art generators.
One color palette for the whole pixel art set
A pixel art set usually shares a few dozen colors. Ours, on one grid, still held 74,323, nearly all in the cave; Bix alone had 128. A short script of ours built one palette of 48: 24 of Bix's own colors first, then reserved colors, a few kept in the list for one asset, then 15 from everything else. The toolbox moves every pixel of a picture to its nearest color in that list:
$ ludo toolbox image recolor bat.png --palette pal_bix48.hex
{"image":"ludo-output/bat.png","width":128,"height":128,
"colors":{"before":128,"after":28}}
The reserved colors are the tip. Purple covers 45% of the bat. On 48 shared colors with none reserved it fell to 19%; with three purples of its own it is 44%. Bix barely moves: his average color shift is 3.5, on a scale where about 2 is the smallest difference most people can see. If your game already has a palette, use that file: recolor takes any .hex list.
Pixel art in Godot: the settings that keep every block the same size
- Viewport 640 x 360, window 1920 x 1080.
- Stretch Mode viewport and Scale Mode integer, so every game pixel is exactly 3 x 3 screen pixels.
- Default Texture Filter Nearest.
- Every picture drawn at its own size, never scaled in the scene.
Scroll speeds matter too: move the camera and the background a whole number of game pixels each frame (ours is 2), or the layers shudder against each other. For the import steps, see exporting sprites to Unity, Godot and GameMaker.
The Godot script and the level are ours, 498 lines, and there is no build you can play: the script drives Bix, deciding when he swings, jumps and gets hit.
Pixel art sprite animation that stays on the grid
Bix's moves come from the Sprite Generator: his picture as the first frame, the Forge Pixel model, a few words for the motion, and Sprite Size on True Size, which returns frames at the input's own size, so one file pixel is still one block. One recolor then puts the frames on the palette. The pixel art sprites guide has the settings.
The attack took the most review. "The mole is not holding the axe pick" was answered with a Change Pose first (the Attack Ready preset plus "gripping the pickaxe handle in both hands"). "The attack animation is weak" was answered with a larger canvas, so the arc had room, and the motion "overhead pickaxe smash, big wind-up, both hands on the handle". Then:
"It turns into a scythe at the end of the animation."Miguel, on the swing we had just called finished
At game speed none of us had seen it. The tip: check a thin prop frame by frame at four times its size, and touch up single frames with a masked Edit Image, an edit limited to the area you paint over, with a good frame as the reference. The end of Bix's swing was touched up that way.
The sound is Ludo's as well: twelve short effects and a cave ambiance from the Audio Generator, one line of description each.
Check before import: a consistency checklist for AI game art
ludo toolbox image scale for clean grids, Ludo Convert to Pixel Art for the rest.ludo toolbox image paletteBuild one palette from the hero's colors, then ludo toolbox image recolorludo toolbox image repeatLudo Horizontal Tiling Sprite, checked again after any change.For how a solo developer held one look across a much larger cast, read Veridium: Final Pulse; for a side by side of tools, our roundup of AI image generators for game art.
What the art, animation and sound cost in Ludo credits
| Stage | Generations | Ludo credits |
|---|---|---|
| Comparing three styles: Bix in each, seven assets made two ways in each, two test animations (6 credits) | 47 | 52.5 |
| First game build: the profile bat, a walk and a flap, first sounds, two music beds for the video | 10 | 24 |
| Gameplay pass: poses, the icy beetle, seven moves, nine sound effects | 19 | 45 |
| The same steps run in the app for the video (the Bix in the game came from these) | 8 | about 9 |
| Rebuild around Bix's pixel size: six moves, a cave run | 10 | about 23.5 |
| Attack animation iterations | 18 | about 61 |
| Art, animation and sound | 112 | about 215 |
About 60 of those credits are in the finished game: eight pictures, six animations, twelve sound effects and the ambiance. The rest went on comparing three styles and trying alternative moves. The app runs were read off a shared credit counter, so those rows are approximate, and the receipt leaves out the video's narration voice. Whatever you make with Ludo, you own.
Questions people ask
Why does my AI pixel art have different pixel sizes? A pixel style sizes its grid to suit each picture, so a character, a tile and an icon can each sit on a different block size. Measure the hero's block, make that one game pixel, and bring the others to it: shrink clean grids by their block size, convert the rest.
What screen resolution should a pixel art game use? Work backwards from the hero. Ours is 128 game pixels across, and 640 x 360 gives him the right share of a screen that scales by exactly 3 to 1080p and by 6 to 4K.
How many colors should a pixel art palette have? Enough that the hero does not visibly change. We measured 32 and 48 built around Bix; at 32 the beetle shifted more than twice as far, so we used 48.
Does this only work for pixel art? The first lock works for any style, and our comparison covered Hand-Painted and Cel-Shaded too. The pixel size and palette locks are pixel art jobs.
Make a hero, then make everything else match.
Try Ludo free

