pixelkiln 0.139.0 → 0.139.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PROVIDERS.md +3 -2
- package/docs/PARALLAX.md +258 -0
- package/docs/README.md +2 -1
- package/docs/RESEARCH_PARALLAX.md +66 -30
- package/docs/RETRO_DIFFUSION.md +6 -5
- package/package.json +1 -1
- package/skills/pixelkiln/references/parallax.md +25 -6
package/PROVIDERS.md
CHANGED
|
@@ -143,8 +143,9 @@ For a production environment, build a kit: seamless terrain, separate
|
|
|
143
143
|
landmarks and buildings, foreground occluders, and a distant backdrop. You can
|
|
144
144
|
rerun one weak piece, set collision per object, and move layers independently
|
|
145
145
|
for parallax. Generate each piece at its native pixel resolution, then use
|
|
146
|
-
integer nearest-neighbor scaling. The [parallax
|
|
147
|
-
|
|
146
|
+
integer nearest-neighbor scaling. The [parallax guide](./docs/PARALLAX.md) builds a
|
|
147
|
+
layered background step by step, and the [research note](./docs/RESEARCH_PARALLAX.md)
|
|
148
|
+
covers looping, splitting a flat picture by depth, and engine settings.
|
|
148
149
|
|
|
149
150
|
A visual benchmark should use the same briefs for an isolated building, a
|
|
150
151
|
top-down landmark, and a full scenic background. Use the same intended native
|
package/docs/PARALLAX.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Parallax backgrounds
|
|
2
|
+
|
|
3
|
+
A parallax background is a stack of layers that scroll at different speeds as
|
|
4
|
+
the camera moves. PixelKiln has no parallax command yet, so this guide builds
|
|
5
|
+
one from ordinary manifest assets and a free script. Everything below was run
|
|
6
|
+
to make the pictures on this page: two biomes, 51 PixelLab generations in all,
|
|
7
|
+
including the retries. The evidence behind each choice is in the
|
|
8
|
+
[research note](./RESEARCH_PARALLAX.md).
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
## Pick a route
|
|
15
|
+
|
|
16
|
+
Both routes start the same way, with one palette and a pixflux style. They
|
|
17
|
+
differ in what you generate.
|
|
18
|
+
|
|
19
|
+
| Route | What you generate | Best for |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Silhouettes | Four or five isolated landforms a biome, each about 240 px wide. The game lays them in overlapping runs. | Levels wider than any picture. No layer needs to loop, and the runs never repeat exactly. |
|
|
22
|
+
| Whole layers | A far range, a middle layer and a near layer, each 400×100, looped afterwards. | The fewest steps. A short level, a title screen, a menu. |
|
|
23
|
+
|
|
24
|
+
The two mix well. Both pictures above use a whole far range and a whole near
|
|
25
|
+
layer; the volcanic one puts two runs of silhouettes between them.
|
|
26
|
+
|
|
27
|
+
The sky is not generated in either route. It is a few flat bands of palette
|
|
28
|
+
colours, drawn by the script or by the engine. Hosted generators draw
|
|
29
|
+
mountains and suns into a sky whatever the prompt says.
|
|
30
|
+
|
|
31
|
+
## 1. Choose one palette
|
|
32
|
+
|
|
33
|
+
Every layer uses the same forced `palette`. It is the single setting that
|
|
34
|
+
makes separately generated layers look like one scene. The easiest source is
|
|
35
|
+
a picture you already like: its colours, 30 to 50 of them, become the palette.
|
|
36
|
+
The volcanic set uses the 44 colours of a PixelLab volcano; the alpine set uses
|
|
37
|
+
the 38 colours of a PixelLab mountain valley.
|
|
38
|
+
|
|
39
|
+
Check the palette has pale colours as well as dark ones. A tier is pushed
|
|
40
|
+
toward the sky by mixing its colours and snapping the result back to the
|
|
41
|
+
palette (step 5). A palette with few pale colours flattens a tinted tier into
|
|
42
|
+
one or two colours.
|
|
43
|
+
|
|
44
|
+
## 2. Write the manifest
|
|
45
|
+
|
|
46
|
+
One pixflux style per seed, with background removal, `view: side` and the
|
|
47
|
+
palette. Listing several styles on an asset gives several candidates of it,
|
|
48
|
+
one per seed, so you can keep the best.
|
|
49
|
+
|
|
50
|
+
```jsonc
|
|
51
|
+
{
|
|
52
|
+
"name": "my-game",
|
|
53
|
+
"provider": "pixellab",
|
|
54
|
+
"styles": {
|
|
55
|
+
"parallax-a": {
|
|
56
|
+
"generator": "pixflux",
|
|
57
|
+
"noBackground": true,
|
|
58
|
+
"view": "side",
|
|
59
|
+
"seed": 101,
|
|
60
|
+
"palette": ["#050a14", "#2e3253", "#7b5f94", "..."],
|
|
61
|
+
"outDir": "assets/parallax/volcanic/a"
|
|
62
|
+
},
|
|
63
|
+
"parallax-b": {
|
|
64
|
+
"generator": "pixflux",
|
|
65
|
+
"noBackground": true,
|
|
66
|
+
"view": "side",
|
|
67
|
+
"seed": 202,
|
|
68
|
+
"palette": ["#050a14", "#2e3253", "#7b5f94", "..."],
|
|
69
|
+
"outDir": "assets/parallax/volcanic/b"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"assets": {
|
|
73
|
+
"landform-cone": {
|
|
74
|
+
"prompt": "a single dark basalt volcanic cone, muted violet, low contrast, simple shading, about two thirds as wide as the picture, its slopes flare out to a flat base, a lone landform game sprite on a plain empty background, nothing else in the picture: no clouds, no moon, no sun, no hills or ground around it, side view, transparent background",
|
|
75
|
+
"width": 256,
|
|
76
|
+
"height": 128,
|
|
77
|
+
"styles": ["parallax-a", "parallax-b"]
|
|
78
|
+
},
|
|
79
|
+
"layer-near": {
|
|
80
|
+
"prompt": "dark jagged volcanic hills close to the viewer, uneven heights and irregular shapes, a few glowing lava cracks, nearly black, spans the full width, flat bottom edge, no sky, no ground plane, side view, transparent background",
|
|
81
|
+
"width": 400,
|
|
82
|
+
"height": 100,
|
|
83
|
+
"styles": ["parallax-a", "parallax-b"]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The complete manifests for both biomes are in
|
|
90
|
+
[`benchmarks/parallax-refined`](../benchmarks/parallax-refined).
|
|
91
|
+
|
|
92
|
+
Keep transparent pixflux pictures at 40,000 px or less (400×100, 256×128).
|
|
93
|
+
Larger ones come back with their background.
|
|
94
|
+
|
|
95
|
+
### Prompts that work
|
|
96
|
+
|
|
97
|
+
For a silhouette, describe one object as a game sprite and list what must not
|
|
98
|
+
be in the picture. Leave the distance out of the prompt: the haze comes later,
|
|
99
|
+
from the palette.
|
|
100
|
+
|
|
101
|
+
- Use "a lone landform game sprite on a plain empty background, nothing else in
|
|
102
|
+
the picture: no clouds, no moon, no sun, no hills or ground around it".
|
|
103
|
+
- Use "about two thirds as wide as the picture" so it does not run off the
|
|
104
|
+
sides.
|
|
105
|
+
- Avoid "distant", "seen from far away", "hazy dusk light" and "fading to
|
|
106
|
+
nothing at its foot". They make pixflux paint a whole scene. In the first
|
|
107
|
+
round, every volcanic silhouette asked for that way came back with ground,
|
|
108
|
+
clouds or a moon, and 14 of 18 silhouettes ran off the canvas.
|
|
109
|
+
- Avoid a glow at a crater's top. Pixflux draws it as a setting sun.
|
|
110
|
+
|
|
111
|
+

|
|
112
|
+
|
|
113
|
+
For a whole layer, ask for the full width and a flat bottom edge. A far range
|
|
114
|
+
comes back as a flat single-colour band, which is right for the farthest layer;
|
|
115
|
+
it is recoloured in step 5.
|
|
116
|
+
|
|
117
|
+
## 3. Plan and generate
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pixelkiln plan
|
|
121
|
+
pixelkiln gen --budget pixellab=18
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`plan` lists one generation an image at these sizes. Three seeds of six assets
|
|
125
|
+
is 18 generations a biome. Plan for a retry round: the alpine and volcanic sets
|
|
126
|
+
each needed one.
|
|
127
|
+
|
|
128
|
+
## 4. Keep the best candidate
|
|
129
|
+
|
|
130
|
+
Look at every candidate on a plain colour, then reject the ones that break the
|
|
131
|
+
stack:
|
|
132
|
+
|
|
133
|
+
- A silhouette that touches the left or right edge. Its cut-off side shows as a
|
|
134
|
+
straight vertical line in a run.
|
|
135
|
+
- Anything with a horizon line, a reflection, clouds or a moon in it.
|
|
136
|
+
- A whole layer that does not span the width. It leaves gaps when it repeats.
|
|
137
|
+
- A middle layer that is one landmark, such as a single volcano. It is fine,
|
|
138
|
+
but draw it once instead of looping it (step 6), or the repeat is obvious.
|
|
139
|
+
|
|
140
|
+
The script prints the numbers for the first check:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
python3 research/scripts/parallax.py screen assets/parallax/volcanic/*/landform-*.png
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
`edge 0.00/0.00` means nothing touches either side. The script needs numpy,
|
|
147
|
+
pillow and scipy.
|
|
148
|
+
|
|
149
|
+
## 5. Finish the pieces
|
|
150
|
+
|
|
151
|
+
All of these are free and keep every pixel on the palette.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
P="python3 research/scripts/parallax.py"
|
|
155
|
+
|
|
156
|
+
# Silhouettes: trim, then thin out the bottom 30% with an ordered dither.
|
|
157
|
+
$P foot cone.png cone.foot.png 0.3
|
|
158
|
+
|
|
159
|
+
# One copy a tier, each pulled toward its own colour and snapped to the palette.
|
|
160
|
+
$P tint cone.foot.png cone.far.png "#7f4776" 0.55 pixelkiln.manifest.json
|
|
161
|
+
$P tint cone.foot.png cone.near.png "#403a61" 0.4 pixelkiln.manifest.json
|
|
162
|
+
|
|
163
|
+
# Whole layers: loop at the best matching columns. Recolour the flat far range.
|
|
164
|
+
$P loop layer-far.png far.png cut
|
|
165
|
+
$P tint far.png far.png "#936090" 1 pixelkiln.manifest.json
|
|
166
|
+
$P loop layer-near.png near.png cut
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+

|
|
170
|
+
|
|
171
|
+
**The dithered foot.** Background removal leaves every pixel fully on or off,
|
|
172
|
+
so a silhouette cannot fade by alpha. Thinning its bottom rows with a 4×4
|
|
173
|
+
pattern makes it dissolve into whatever is behind it and keeps it pixel art.
|
|
174
|
+
|
|
175
|
+
**Depth order.** The farther a layer, the closer to the sky's colour and the
|
|
176
|
+
lower its contrast. Check the order from back to front: the far range lightest,
|
|
177
|
+
then the far tier, the near tier, and the near layer darkest. Snow can stay
|
|
178
|
+
bright on a near tier, as long as its shadows are darker than the range behind
|
|
179
|
+
it. Tinting every tier toward one light haze colour gets the order backwards:
|
|
180
|
+
the near tier ends up lighter than the range behind it.
|
|
181
|
+
|
|
182
|
+
**The far range.** Pick a palette colour that sits between the sky bands behind
|
|
183
|
+
it, darker than the horizon and lighter than the tiers.
|
|
184
|
+
|
|
185
|
+
## 6. Preview the stack
|
|
186
|
+
|
|
187
|
+
The script draws the sky and scrolls the whole stack, from a small JSON file:
|
|
188
|
+
|
|
189
|
+
```jsonc
|
|
190
|
+
{
|
|
191
|
+
"view": [384, 216],
|
|
192
|
+
"sky": ["#2e3253", "#503e68", "#7b5f94", "#ad628e", "#d66283", "#f96076"],
|
|
193
|
+
"seed": 7,
|
|
194
|
+
"frames": 120,
|
|
195
|
+
"travel": 480,
|
|
196
|
+
"layers": [
|
|
197
|
+
{ "image": "far.png", "bottom": 150, "speed": 0.125, "extend": true },
|
|
198
|
+
{ "run": ["cone.far.png", "rim.far.png", "mesa.far.png"], "foot": 158, "speed": 0.25 },
|
|
199
|
+
{ "run": ["cone.near.png", "rim.near.png", "mesa.near.png"], "foot": 176, "speed": 0.5 },
|
|
200
|
+
{ "fill": "#0e0c20", "top": 206, "speed": 1 },
|
|
201
|
+
{ "image": "near.png", "bottom": 246, "speed": 1 }
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
STILL=still.png SCALE=2 python3 research/scripts/parallax.py skyline preview.webp stack.json
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
- `extend` on the far range repeats its bottom row to the foot of the view, so
|
|
211
|
+
the tiers' dithered feet dissolve into distant land, not into sky.
|
|
212
|
+
- A run lays its sprites left to right, each starting 72% of the way across
|
|
213
|
+
the last, flipped at random and never the same one twice in a row.
|
|
214
|
+
- An image with `"repeat": false` and an `x` is drawn once: use it for a
|
|
215
|
+
landmark.
|
|
216
|
+
- The camera pans `travel` pixels and back. Watch the far end of the pan for
|
|
217
|
+
seams, floating feet and gaps under the near layer.
|
|
218
|
+
|
|
219
|
+
The specs and the build script for both biomes are in
|
|
220
|
+
[`benchmarks/parallax-refined`](../benchmarks/parallax-refined).
|
|
221
|
+
|
|
222
|
+
## 7. Put it in the engine
|
|
223
|
+
|
|
224
|
+
Speed is the fraction of the camera's movement a layer follows. The previews
|
|
225
|
+
use 0 for the sky, 1/8 for the far range, 1/4 and 1/2 for the two tiers, and 1
|
|
226
|
+
for the near layer.
|
|
227
|
+
|
|
228
|
+
- Round the camera to whole pixels first, then take each layer's offset from
|
|
229
|
+
that rounded position. Rounding each layer on its own moves layers while the
|
|
230
|
+
camera stands still.
|
|
231
|
+
- Prefer simple fractions (1/2, 1/4, 1/8). They step on an even rhythm; 0.3 or
|
|
232
|
+
0.6 do not.
|
|
233
|
+
- Keep the tiers' speeds close together. A wide spread opens bands of sky
|
|
234
|
+
between them.
|
|
235
|
+
- A bounded level needs no loop. Lay each run past both ends of the level by
|
|
236
|
+
the most that layer can drift.
|
|
237
|
+
|
|
238
|
+
The same layer at a quarter of the camera's speed in each tool:
|
|
239
|
+
|
|
240
|
+
| Tool | Setting |
|
|
241
|
+
|---|---|
|
|
242
|
+
| Tiled | `parallaxx: 0.25` |
|
|
243
|
+
| Godot 4 | `Parallax2D.scroll_scale = Vector2(0.25, 1)` |
|
|
244
|
+
| Phaser 3 | `setScrollFactor(0.25, 1)` |
|
|
245
|
+
| LDtk | `parallaxFactorX: 0.75` with `parallaxScaling: false` |
|
|
246
|
+
|
|
247
|
+
LDtk counts the other way: its factor is how much the layer follows the
|
|
248
|
+
camera, so write 1 − speed. With `parallaxScaling` on it also shrinks a far
|
|
249
|
+
layer off the pixel grid. PixelKiln's LDtk export writes factor 0 today.
|
|
250
|
+
|
|
251
|
+
## What this guide does not cover
|
|
252
|
+
|
|
253
|
+
- Splitting a finished scene into layers. A depth model and inpainting can do
|
|
254
|
+
it, at 10 to 25 PixelLab generations a layer for the fill; see steps 4, 13
|
|
255
|
+
and 14 of the [research note](./RESEARCH_PARALLAX.md).
|
|
256
|
+
- Retro Diffusion. Its environment style draws a whole scene whatever the
|
|
257
|
+
prompt says, so it is not a layer generator (step 15).
|
|
258
|
+
- A `pixelkiln parallax` command. The research note sketches one.
|
package/docs/README.md
CHANGED
|
@@ -29,7 +29,8 @@ provider you are using. These Markdown files also render at
|
|
|
29
29
|
| [Environment provider benchmark](./PROVIDER_BENCHMARK.md) | Compare PixelLab, Retro Diffusion, and ComfyUI on buildings, backgrounds, cleanup, and native-grid recovery. |
|
|
30
30
|
| [3D characters from sprites](./CHARACTERS_3D.md) | An experimental pipeline from directional sprites to a rigged, animated 3D character with separate items: a pixel path and a painted path, the steps, and what each costs. Scripts, not a command. |
|
|
31
31
|
| [Research: 3D models from sprites](./RESEARCH_3D.md) | Every attempt to turn eight directional sprites into a 3D model, with pictures. Research, not a feature. |
|
|
32
|
-
| [
|
|
32
|
+
| [Parallax backgrounds](./PARALLAX.md) | Build a scrolling background in layers from one palette: silhouettes or whole layers from PixelLab, the prompts that work, finishing by script, a preview, and engine settings. |
|
|
33
|
+
| [Research: parallax backgrounds](./RESEARCH_PARALLAX.md) | The evidence behind the parallax guide: every way tried to build a background in depth and to get its layers out of a generator. Research, not a feature. |
|
|
33
34
|
| [Controlled asset revisions](./REVISIONS.md) | Image-to-image and inpaint edits, PixelLab palette cleanup, animation, skeleton posing, and interpolation from a parent asset; masks, approval gates, side-by-side review, and ComfyUI bindings. |
|
|
34
35
|
| [Derived artifacts](./ARTIFACTS.md) | Refine, pack, mount, and export; provenance, approval gates, ownership, and crash recovery. |
|
|
35
36
|
| [Recovery and account safety](./RECOVERY.md) | Restore, caches, adopt, salvage, cross-project claims, tagging, and confirmed purge. |
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Parallax backgrounds
|
|
2
2
|
|
|
3
|
-
This is a research note, not a feature: nothing here is a PixelKiln command, and the scripts are rough. PixelKiln can generate a scenic background as one flat picture. A parallax background is several layers that scroll at different speeds as the camera moves. This note covers the ways to build one and the ways to get the layers out of AI generators. Steps 1 to 11 use art we already had. Step 12 records how a game that already uses PixelKiln builds its skyline. Steps 13 to 16 spent 17 PixelLab generations and $0.24 of Retro Diffusion. Step 17 ran a layer-splitting model on our own 12 GB GPU.
|
|
3
|
+
This is a research note, not a feature: nothing here is a PixelKiln command, and the scripts are rough. PixelKiln can generate a scenic background as one flat picture. A parallax background is several layers that scroll at different speeds as the camera moves. This note covers the ways to build one and the ways to get the layers out of AI generators. Steps 1 to 11 use art we already had. Step 12 records how a game that already uses PixelKiln builds its skyline. Steps 13 to 16 spent 17 PixelLab generations and $0.24 of Retro Diffusion. Step 17 ran a layer-splitting model on our own 12 GB GPU. Step 18 spent 51 PixelLab generations refining the two routes that worked into the sets below.
|
|
4
|
+
|
|
5
|
+
To build one, follow the [parallax guide](./PARALLAX.md). This note is the evidence behind it. Pictures are kept only where they show a result worth using or the one fault a step found; the rest is in the text and the scripts.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+

|
|
4
10
|
|
|
5
11
|
Last updated 23 November 2026.
|
|
6
12
|
|
|
@@ -23,8 +29,9 @@ Last updated 23 November 2026.
|
|
|
23
29
|
| 13 | Cut by depth per pixel instead of per column | Depth Anything V2 Small, our script | The plume moves on its own and the sky stays whole; the cheap fill smears sideways where a framing tree moves away | Keep the per-pixel cut. The fill needs step 14. |
|
|
24
30
|
| 14 | Inpaint what a near layer hid | PixelLab `inpaint_image`, 10 generations | Forest and slope in place of smears; nothing outside the mask changed; 2 new colours | Keep for a scene that has to be split. |
|
|
25
31
|
| 15 | Generate each layer on its own, wide | PixelLab pixflux with one forced palette, 4 generations; Retro Diffusion environment with `tile_x`, $0.24 | PixelLab's four layers agree and scroll as one scene; Retro Diffusion's each draw a whole scene, and background removal breaks the seam `tile_x` made | Keep PixelLab with a shared palette. Retro Diffusion's environment style is not a layer generator. |
|
|
26
|
-
| 16 | Generate silhouettes and compose a skyline from them | PixelLab pixflux, 3 generations; our script | Usable landforms, but none fades at the foot as asked, so each run ends on a hard dark base | Keep the route; the faded foot needs a
|
|
32
|
+
| 16 | Generate silhouettes and compose a skyline from them | PixelLab pixflux, 3 generations; our script | Usable landforms, but none fades at the foot as asked, so each run ends on a hard dark base | Keep the route; the faded foot needs a cleanup pass. Step 18 dithers it. |
|
|
27
33
|
| 17 | Ask a layer-splitting model for the layers | Qwen-Image-Layered fp8 in ComfyUI, RTX 3060 12 GB, 35 to 42 minutes a picture | The sky and sun come apart from the land with the hidden sun filled in; far range, volcano, near ridges and lava stay in one layer; a blank fill layer and a pink blob take the other slots | Drop for parallax: it splits sky from scene, not near from far, and it is too slow on this card. |
|
|
34
|
+
| 18 | Refine steps 12, 15 and 16: better prompts, three candidates each, finishing by script | PixelLab pixflux, 51 generations over two biomes; our script | A sprite-style prompt gives isolated landforms where a scene-style one did not; a dithered foot, a tint per tier and a scripted sky turn them into stacks that read as one scene | Keep. This is the route the [parallax guide](./PARALLAX.md) teaches. |
|
|
28
35
|
|
|
29
36
|
## Ways to make the effect
|
|
30
37
|
|
|
@@ -46,8 +53,8 @@ There are six ways to make a background move with depth. Most games combine two
|
|
|
46
53
|
|
|
47
54
|
| Route | What it needs | Status here |
|
|
48
55
|
|---|---|---|
|
|
49
|
-
| Generate silhouettes and compose each layer from them in the engine | A few transparent landforms a biome, each fading out at its foot; placement rules in the game | Step 12: in use in a game. |
|
|
50
|
-
| Generate each layer on its own, with a transparent background | A prompt per layer; the layers must agree in palette, light and horizon |
|
|
56
|
+
| Generate silhouettes and compose each layer from them in the engine | A few transparent landforms a biome, each fading out at its foot; placement rules in the game | Step 12: in use in a game. Step 18: two working sets from PixelLab. |
|
|
57
|
+
| Generate each layer on its own, with a transparent background | A prompt per layer; the layers must agree in palette, light and horizon | Steps 15 and 18. A forced palette shared by every layer is what makes them agree. |
|
|
51
58
|
| Generate one picture and split it with a depth model | A depth model and a fill for what the near layers hid | Steps 4 to 6, 13 and 14. |
|
|
52
59
|
| A model that outputs layers directly | LayerDiffuse on SDXL, or Qwen-Image-Layered | Step 17: Qwen-Image-Layered splits sky from scene, not by distance, and takes over half an hour a picture on a 12 GB card. LayerDiffuse is untried. Neither is trained on pixel art. |
|
|
53
60
|
| A wide picture that wraps, then cut into layers | A provider's seamless option, or step 2 on the result | Retro Diffusion's `tile_x` is the only hosted seamless flag found. |
|
|
@@ -97,7 +104,7 @@ The one low ratio is a coincidence of composition: Retro Diffusion's alpine vall
|
|
|
97
104
|
|
|
98
105
|

|
|
99
106
|
|
|
100
|
-
**Verdict.** The cut and the crossfade both make a loop that holds up at the join. The mirror closes the seam perfectly and shows its symmetry at once
|
|
107
|
+
**Verdict.** The cut and the crossfade both make a loop that holds up at the join. The mirror closes the seam perfectly and shows its symmetry at once. All three expose the bigger problem: a scenic picture has a focal point, and a repeating peak or volcano is obvious. A loop wants a layer with no single landmark, which is also Pixelblog 23's advice. Landmarks belong on a layer of their own that does not repeat, or repeats rarely.
|
|
101
108
|
|
|
102
109
|
## 3. Split by distance from the sky colour
|
|
103
110
|
|
|
@@ -105,9 +112,7 @@ The one low ratio is a coincidence of composition: Retro Diffusion's alpine vall
|
|
|
105
112
|
|
|
106
113
|
**Setup.** `parallax.py split <png> <out> 4`. Nearness is each pixel's RGB distance from the median colour of the top rows, median-filtered over 5×5. A 1D k-means finds three cut points. For each cut, a skyline is the first row in each column where nearness stays above the cut for three rows, kept in depth order. Layer *k* is everything from its skyline down. Where a nearer layer hid it, the gap is filled by reflecting the layer's own rows, so a revealed gap shows its texture rather than a smear. Composited at rest, the layers rebuild the source exactly; the script checks this.
|
|
107
114
|
|
|
108
|
-
**Result.** On the volcano
|
|
109
|
-
|
|
110
|
-

|
|
115
|
+
**Result.** On the volcano, the bands follow colour: the lit flank of the volcano lands in one band and its shadowed flank in another, and the sun gets a band of its own.
|
|
111
116
|
|
|
112
117
|
**Verdict.** Drop. Colour is a poor stand-in for distance as soon as a scene has its own light.
|
|
113
118
|
|
|
@@ -123,8 +128,6 @@ The one low ratio is a coincidence of composition: Retro Diffusion's alpine vall
|
|
|
123
128
|
|
|
124
129
|
Retro Diffusion's alpine valley A is the exception. Tall trees frame it from the top of the picture to the bottom on both sides. A skyline split assumes the near ground starts lower in every column than what is behind it, so it puts the whole frame in the nearest layer along with the full column above it, and most of each layer would have to be invented as the camera moves.
|
|
125
130
|
|
|
126
|
-

|
|
127
|
-
|
|
128
131
|
The script also counts the pixels a layer does not have but would show if the layer in front of it moved a twelfth of the picture's width (32 px on the volcano) relative to it. These are the pixels the fill makes up. With the depth map they are 15 to 40% of a layer on the PixelLab pictures, and 29 to 101% on the framed Retro Diffusion one. The count is an upper bound and depends on how far the camera travels.
|
|
129
132
|
|
|
130
133
|
**Verdict.** Keep, for open landscapes composed as layers already. A scene composed for one frame needs per-pixel layers and a real fill, which this note has not tried.
|
|
@@ -142,10 +145,6 @@ The script also counts the pixels a layer does not have but would show if the la
|
|
|
142
145
|
|
|
143
146
|

|
|
144
147
|
|
|
145
|
-

|
|
146
|
-
|
|
147
|
-

|
|
148
|
-
|
|
149
148
|
**Verdict.** Keep, with step 6. Floating things (smoke, clouds, birds, a moon) need to be cut out as their own sprites instead of riding a skyline.
|
|
150
149
|
|
|
151
150
|
## 6. Grow each near layer
|
|
@@ -168,8 +167,6 @@ The script also counts the pixels a layer does not have but would show if the la
|
|
|
168
167
|
|
|
169
168
|

|
|
170
169
|
|
|
171
|
-

|
|
172
|
-
|
|
173
170
|
**Verdict.** Keep for floors, water, cloud bands and wide valleys. Combine it with layers: line-scroll the ground layer and move the tall shapes as layers.
|
|
174
171
|
|
|
175
172
|
## 8. Do generators already push the distance back?
|
|
@@ -279,8 +276,6 @@ The same layer, at a quarter of the camera's speed, in each tool:
|
|
|
279
276
|
|
|
280
277
|

|
|
281
278
|
|
|
282
|
-

|
|
283
|
-
|
|
284
279
|
The price is invention. The fill has to make up 115 to 189% of a layer's own pixel count on the volcano and 175 to 333% on the framed valley, because the bands are thin and the pan is long. Where a framing tree slides away, the cheap fill shows as sideways smears (step 14, left).
|
|
285
280
|
|
|
286
281
|
**Verdict.** Keep the per-pixel cut. The fill is the weak part.
|
|
@@ -310,14 +305,10 @@ The PixelLab layers were looped with step 2's crossfade, because pixflux has no
|
|
|
310
305
|
|
|
311
306
|
**Result.**
|
|
312
307
|
|
|
313
|
-

|
|
314
|
-
|
|
315
|
-

|
|
316
|
-
|
|
317
308
|
- **PixelLab** reads as one scene: same palette, same light, a clean cutout on all three layers (60 to 71% transparent). The far range came back as a flat two-colour silhouette, so it reads as a band of fog. The sky drew a mountain and hills along its bottom despite "no mountains".
|
|
318
309
|
- **Retro Diffusion** does not. The environment style draws a whole scene whatever the prompt says: the sky has its own volcano and river, the far layer is a range with sky still on it, and the near layer is a wall. `tile_x` works on the drawing: the sky wraps with a seam no rougher than its inside (ratio 1.0). Background removal then breaks it: the near layer keeps ground on one side of the join and removes it on the other (seam ratio 3.9).
|
|
319
310
|
|
|
320
|
-
**Verdict.** Keep PixelLab pixflux with one forced palette for every layer: it is the cheapest route in this note and the layers agree. Retro Diffusion's environment style is a scene generator, not a layer generator; its `tile_x` is still the only hosted seamless option found, and would suit a sky or a layer that needs no background removal.
|
|
311
|
+
**Verdict.** Keep PixelLab pixflux with one forced palette for every layer: it is the cheapest route in this note and the layers agree. Retro Diffusion's environment style is a scene generator, not a layer generator; its `tile_x` is still the only hosted seamless option found, and would suit a sky or a layer that needs no background removal. Step 18 fixes the fog-band far range and the sky with mountains in it, and its pictures replace this step's.
|
|
321
312
|
|
|
322
313
|
## 16. A skyline from generated silhouettes
|
|
323
314
|
|
|
@@ -327,9 +318,7 @@ The PixelLab layers were looped with step 2's crossfade, because pixflux has no
|
|
|
327
318
|
|
|
328
319
|
**Result.** The landforms are usable and cut out cleanly, 44 to 73% transparent. None fades at the foot: pixel-art background removal gives a pixel either fully on or off, so each comes back with a hard dark base, a disc under the cone and a plateau under the mesa. In a run those bases read as a black band where step 12's game shows haze.
|
|
329
320
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
**Verdict.** Keep the route. The faded foot has to come from somewhere else: a generator that returns soft alpha (the game's redraws came from Scenario), a dithered fade drawn afterwards, or a skirt and treeline in front, as step 12's game uses.
|
|
321
|
+
**Verdict.** Keep the route. The faded foot has to come from somewhere else: a generator that returns soft alpha (the game's redraws came from Scenario), a dithered fade drawn afterwards, or a skirt and treeline in front, as step 12's game uses. Step 18 draws the dithered fade and finds the prompt that gives isolated landforms.
|
|
333
322
|
|
|
334
323
|
## 17. A model that splits a picture into layers
|
|
335
324
|
|
|
@@ -339,8 +328,6 @@ The PixelLab layers were looped with step 2's crossfade, because pixflux has no
|
|
|
339
328
|
|
|
340
329
|
**Result.**
|
|
341
330
|
|
|
342
|
-

|
|
343
|
-
|
|
344
331
|
- **It runs, slowly.** The model does not fit beside the desktop's own use of the card, so ComfyUI streams the weights from system RAM every step: about 40 s a step, 35 minutes for 4 layers and 42 for 3.
|
|
345
332
|
- **The split is sky against everything else.** In both runs the back layer is a flat near-white fill and one layer holds the sky and sun. A single layer holds the far range, the volcano and its plume, the near ridges and the lava. The 4-layer run spent its extra slot on a pink blob over the lower half that matches nothing in the scene. Nothing in front can move at a different speed from anything behind it.
|
|
346
333
|
- **What it does well.** The sun behind the volcano is filled in on the sky layer, which is the work step 14 paid PixelLab to do. Stacked back to front, the layers rebuild the input to within 3.5 of 255 per channel on average.
|
|
@@ -350,6 +337,35 @@ Other prompts, seeds and the full-precision model were not tried. The model's do
|
|
|
350
337
|
|
|
351
338
|
**Verdict.** Drop for parallax. It separates the objects a person would select, not the distances a camera would see, and a picture takes over half an hour on this card. Splitting by a depth map (steps 4 and 13) with inpainting (step 14) stays the route for a picture that has to be split.
|
|
352
339
|
|
|
340
|
+
## 18. Refine the two routes that worked
|
|
341
|
+
|
|
342
|
+
**Question.** Steps 12, 15 and 16 found two routes worth keeping, but their pictures were weak: silhouettes with hard dark bases, a far range that read as a band of fog, and a sky with mountains drawn into it. How good can they get with better prompts, a choice of candidates, and finishing by script?
|
|
343
|
+
|
|
344
|
+
**Setup.** Two biomes, each on one forced palette: volcanic dusk on the 44 colours of the step 4 volcano, and alpine dusk on the 38 colours of PixelLab's alpine valley A. Every asset was generated at three seeds (101, 202, 303) through PixelKiln: three silhouettes at 256×128 and three whole layers (far, middle, near) at 400×100, all pixflux with background removal and `view: side`. That is 36 generations. The silhouette retries cost 9 more volcanic and 6 more alpine, 51 in all. The manifests, lockfiles, preview specs and build script are in [`benchmarks/parallax-refined`](../benchmarks/parallax-refined). The sky is not generated: `parallax.py sky` draws six flat palette bands with a dithered step between neighbours.
|
|
345
|
+
|
|
346
|
+
**Result.**
|
|
347
|
+
|
|
348
|
+
- **The prompt decides whether a silhouette is a sprite or a scene.** The first round used step 16's pattern: "distant", "hazy dusk light as if seen from far away", "fading to nothing at its foot". All nine volcanic silhouettes came back as small scenes, with ground, clouds or a moon. 14 of the 18 silhouettes over both biomes ran off the side of the canvas, and a glow asked for at a crater was drawn as a setting sun. The retry described one object as "a lone landform game sprite on a plain empty background", listed what must not be in the picture, asked for "about two thirds as wide as the picture", and left the distance and the glow out. All 15 retries came back as one isolated landform each, and 14 were clear of both sides; the fifteenth, a ridge, touched the right edge at its foot, where the dithered fade thins it out.
|
|
349
|
+
|
|
350
|
+

|
|
351
|
+
|
|
352
|
+
- **Whole layers came back usable on the first round.** Every far range was a flat one-colour band, which suits the farthest layer once it is recoloured. The alpine middle and near layers (sunlit peaks, a pine treeline) were good on every seed. Every volcanic middle layer was a single volcano, which repeats obviously, so the preview draws it once as a landmark instead of looping it.
|
|
353
|
+
- **A dithered foot replaces soft alpha.** `parallax.py foot` trims a silhouette and thins its bottom 30% with a 4×4 ordered dither, so it dissolves into whatever is behind it and stays pixel art.
|
|
354
|
+
|
|
355
|
+

|
|
356
|
+
|
|
357
|
+
- **Each tier needs its own tint target.** `parallax.py tint` mixes a picture toward a colour and snaps it to the biome palette. Tinting both tiers toward one light haze colour made the near tier lighter than the far range behind it, so depth read backwards. Pulling the far tier toward a mid violet and the near tier toward a dark one gives the right order: far range lightest, near layer darkest.
|
|
358
|
+
- **A sparse palette flattens a pale tint.** The alpine palette has few pale colours, so snow tinted toward the haze snapped to two or three colours. The alpine near tier keeps its snow at a light tint (0.2) instead.
|
|
359
|
+
- **The far range is extended down, not floated.** Repeating the far range's bottom row to the foot of the view gives the tiers' dithered feet distant land to dissolve into. A flat haze band in its place read as a separate rectangle.
|
|
360
|
+
|
|
361
|
+

|
|
362
|
+
|
|
363
|
+

|
|
364
|
+
|
|
365
|
+
The four previews scroll the whole stack 480 px and back at 0, 1/8, 1/4, 1/2 and 1 of the camera's speed. They are lossless animated WebP, about 1.1 MB each against 2.3 to 3.2 MB as GIF.
|
|
366
|
+
|
|
367
|
+
**Verdict.** Keep both routes, finished this way. Generate silhouettes as sprites, never as distant scenery, and add the distance afterwards with a palette-held tint per tier. Draw the sky. Take two or three seeds of everything: 15 of the 51 candidates made it into the previews, and none from the first silhouette round. The [parallax guide](./PARALLAX.md) walks through it.
|
|
368
|
+
|
|
353
369
|
## A proposal for PixelKiln
|
|
354
370
|
|
|
355
371
|
Research only; nothing here is built.
|
|
@@ -398,12 +414,14 @@ Research only; nothing here is built.
|
|
|
398
414
|
- Retro Diffusion's environment style as a layer generator (step 15), and its background removal on a seamless picture.
|
|
399
415
|
- Asking pixflux for a foot that fades out (step 16).
|
|
400
416
|
- Qwen-Image-Layered as a depth splitter (step 17).
|
|
417
|
+
- Describing a silhouette as distant or hazy in the prompt (step 18). Pixflux paints a scene around it.
|
|
418
|
+
- Tinting every tier toward one light haze colour (step 18). Depth reads backwards.
|
|
401
419
|
|
|
402
420
|
## What is next
|
|
403
421
|
|
|
404
422
|
- **Build the proposal** above: the manifest shape, a preview, and Tiled, Godot and LDtk export. Open the LDtk result in the editor to check the factor's direction.
|
|
405
|
-
- **
|
|
406
|
-
- **A second
|
|
423
|
+
- **Check the finished sets in an engine.** Step 18's previews come from the script; neither set has been placed in Tiled, Godot or Phaser.
|
|
424
|
+
- **A second time of day** on one biome's palette, to see whether a forced palette keeps sets consistent across a day.
|
|
407
425
|
- **Retro Diffusion `tile_x` without background removal** on each layer, with the background keyed out afterwards so the seam survives.
|
|
408
426
|
|
|
409
427
|
## Running the scripts
|
|
@@ -444,4 +462,22 @@ python3 research/scripts/parallax.py scroll <out.gif> 0.05,0.25,0.5,1.0 200 sky.
|
|
|
444
462
|
|
|
445
463
|
# Layers composed from separate silhouettes; the camera pans north to the skyline. Rates are sky,far,near.
|
|
446
464
|
python3 research/scripts/parallax.py compose <out.gif> 0.6,0.85,0.92 7 <silhouette.png>...
|
|
465
|
+
|
|
466
|
+
# Step 18. Numbers for choosing between candidates: how much touches each side, colours, the opaque box.
|
|
467
|
+
python3 research/scripts/parallax.py screen <png>...
|
|
468
|
+
|
|
469
|
+
# Trim a silhouette and dither its bottom 30% out.
|
|
470
|
+
python3 research/scripts/parallax.py foot <png> <out.png> 0.3
|
|
471
|
+
|
|
472
|
+
# Mix toward a colour and snap to the biome palette (a manifest's or a picture's).
|
|
473
|
+
python3 research/scripts/parallax.py tint <png> <out.png> "#7f4776" 0.55 pixelkiln.manifest.json
|
|
474
|
+
|
|
475
|
+
# Flat sky bands with dithered steps, top to bottom.
|
|
476
|
+
python3 research/scripts/parallax.py sky <out.png> 384 216 "#2e3253,#503e68,#7b5f94,#ad628e,#d66283,#f96076"
|
|
477
|
+
|
|
478
|
+
# Side-scrolling preview of runs, whole layers and fills from a JSON spec; .webp or .gif.
|
|
479
|
+
STILL=<first-frame.png> SCALE=2 python3 research/scripts/parallax.py skyline <out.webp> <spec.json>
|
|
480
|
+
|
|
481
|
+
# Everything for step 18 at once.
|
|
482
|
+
sh benchmarks/parallax-refined/build.sh
|
|
447
483
|
```
|
package/docs/RETRO_DIFFUSION.md
CHANGED
|
@@ -257,11 +257,12 @@ resolves that reference to the current result URL and downloads it immediately.
|
|
|
257
257
|
it needs `RD_API_KEY` to refresh the task result. Candidate image URLs are used
|
|
258
258
|
only by the local picker and are not written to the lockfile.
|
|
259
259
|
|
|
260
|
-
The
|
|
261
|
-
16 to
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
260
|
+
The PixelKiln manifest allows width and height from 16 to 8192 pixels, but
|
|
261
|
+
Retro Diffusion output is 16 to 512 pixels, and PixelKiln refuses a larger size
|
|
262
|
+
while planning. Many styles have narrower limits. In the live catalog on 23
|
|
263
|
+
November 2026, `rd_plus__environment` takes 64 to 512 pixels and
|
|
264
|
+
`rd_tile__scene_object` takes 64 to 384. Build very large scenes from separate
|
|
265
|
+
terrain, background, building, landmark, and foreground layers.
|
|
265
266
|
|
|
266
267
|
The [environment benchmark](./PROVIDER_BENCHMARK.md) found clean transparent,
|
|
267
268
|
low-color Retro Diffusion cutouts, while PixelLab followed the more complex
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Parallax backgrounds
|
|
2
2
|
|
|
3
3
|
PixelKiln has no parallax command or manifest field yet. This page is what the
|
|
4
|
-
research so far supports. The
|
|
5
|
-
https://pixelkiln.griffen.codes/docs/
|
|
4
|
+
research so far supports. The step-by-step guide is at
|
|
5
|
+
https://pixelkiln.griffen.codes/docs/parallax, and the evidence, with pictures
|
|
6
|
+
and numbers, at https://pixelkiln.griffen.codes/docs/research-parallax.
|
|
6
7
|
|
|
7
8
|
## The route to try first
|
|
8
9
|
|
|
@@ -24,13 +25,31 @@ this; its numbers are in step 12 of the research note.
|
|
|
24
25
|
- A bounded level needs no loop: extend each run past both ends by the most
|
|
25
26
|
that layer can drift.
|
|
26
27
|
|
|
28
|
+
## Generating silhouettes
|
|
29
|
+
|
|
30
|
+
- Describe one object as a sprite, never as distant scenery: "a lone landform
|
|
31
|
+
game sprite on a plain empty background, nothing else in the picture: no
|
|
32
|
+
clouds, no moon, no sun, no hills or ground around it", "about two thirds as
|
|
33
|
+
wide as the picture". Words like "distant", "hazy" or "fading at its foot"
|
|
34
|
+
make pixflux paint a whole scene, and the shape runs off the canvas.
|
|
35
|
+
- Leave out a glow at a summit; pixflux draws it as a setting sun.
|
|
36
|
+
- Pixflux at 256×128 with background removal, one forced palette, two or three
|
|
37
|
+
seeds an asset. Reject any candidate that touches a side of the canvas.
|
|
38
|
+
- Add the distance afterwards: dither the bottom 30% out, then tint each tier
|
|
39
|
+
toward its own palette colour, the far tier lighter, the near tier darker.
|
|
40
|
+
One light haze colour for every tier makes depth read backwards.
|
|
41
|
+
|
|
27
42
|
## Generating whole layers
|
|
28
43
|
|
|
29
44
|
- PixelLab pixflux with ONE forced palette (`palette`) on every layer is the
|
|
30
|
-
cheapest route that gives layers which agree
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
cheapest route that gives layers which agree. Layers with background
|
|
46
|
+
removal, at most 40,000 px each (400×100) to stay transparent. pixflux has
|
|
47
|
+
no seamless option, so loop each layer afterwards.
|
|
48
|
+
- Draw the sky as flat palette bands instead of generating it: a generated sky
|
|
49
|
+
comes back with mountains in it. A far range comes back as one flat colour;
|
|
50
|
+
recolour it to a palette colour between the sky bands and extend it down to
|
|
51
|
+
the foot of the view so nothing floats. A middle layer that is one landmark
|
|
52
|
+
(a single volcano) goes on screen once, not looped.
|
|
34
53
|
- Retro Diffusion's `rd_plus__environment` draws a whole scene whatever the
|
|
35
54
|
prompt says, so it is not a layer generator. Its `tileX` does wrap the
|
|
36
55
|
drawing, but `removeBg` breaks the seam it made.
|