Commit build outputs via LFS; right-click markers, inline edit box, panel pin
Make a fresh clone servable after `git lfs pull` alone, and rebuildable with `tools/build.py` without re-rendering unchanged PSDs: - Track build/ (rendered base PNGs, previews, world composites), web/tiles/, web/tiles-trimmed/, web/data/world.json and web/data/markers/. Large PNGs and the tile pyramids go through Git LFS (.gitattributes); JSON stays plain. - build.py: decide PSD re-export from build/<id>/base.stamp.json (PSD size, mtime, SHA-256 recorded at export time) instead of file mtimes, which are meaningless after an LFS checkout. Same size + new mtime hashes once and refreshes the stamp; --stamp-only writes stamps for existing base.pngs. - Ignore .DS_Store and .env files; track sources/**/*.jpg through LFS. Viewer: - Right-click (long-press) the map for a category menu that drops a draft marker under the pointer and enters marker edit mode for that map. - Marker editing moves out of the side panel into a box anchored next to the marker: Enter or a left click anywhere else saves, Esc cancels, Delete inside the box; drags save position plus the box contents. - Maps panel expands on hover, header click pins/unpins (status shown in the header), unpinned collapses 2 s after the pointer leaves; Overview is the first list entry instead of a separate button. Only the panel scrolls; the page never grows past the viewport. Hover tooltips render above markers. Also includes the pending source additions (overall square base, skirt textures, AI regeneration tooling and notes), service worker, Caddyfile and map config updates. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
234dc32c86
commit
472c983287
10884 files changed
+48384
-351
No files matched your search
@@ -0,0 +1,213 @@
|
||||
# TODO for the Antigravity (Gemini) agent — produce the AI imagery
|
||||
|
||||
You generate the images. Claude (the other agent) only builds tiles from what
|
||||
you write and shows the result. **Do not call any image API from Claude's side;
|
||||
do not ask Claude for keys.** Everything you need to read is in the repo; the
|
||||
file contract below is what Claude's build consumes.
|
||||
|
||||
Read first: `docs/TODO-gemini-regeneration.md` (the plan), `README.md`
|
||||
(*Experimental: AI-generated skirts*), `tools/composite.py`,
|
||||
`tools/square_base.py`, `tools/regen_world.py`, `tools/tile.py`
|
||||
(`skirt_settings`, `render_skirt` "aligned" mode).
|
||||
|
||||
---
|
||||
|
||||
## Rules (what NOT to touch)
|
||||
|
||||
| Path | Status | Why |
|
||||
| --- | --- | --- |
|
||||
| `build/world/composite-z*.png`, `build/world/mask-z*.png`, `build/world/composite-z*.json` | **derived, read-only** | Produced by `tools/composite.py` from sources + `maps.json`. Re-run the tool if they are stale; never paint into them. (Checked: the current `composite-z5.png` is byte-identical to a fresh run — good.) |
|
||||
| `sources/overall/overall.jpeg` | original, read-only | The real satellite. |
|
||||
| `build/<id>/base.png`, `build/<id>/trimmed.png` | derived, read-only | From the PSDs / `tile.py`. |
|
||||
| `maps.json` `place`, `trim`, `crop` | do not edit | Placements are calibrated; the plan keeps them valid by construction. Only `world.image` / `world.rotate` were meant to change, and that is already done. |
|
||||
| `web/`, `tools/*.py` (except new `tools/ai/*`) | Claude's | Ask instead of editing. |
|
||||
| API keys | never in the repo | `.env` is gitignored; `tools/gemini_image.py` must keep an empty constant. |
|
||||
|
||||
---
|
||||
|
||||
## Deliverable 1 — square base with real corners
|
||||
|
||||
**File:** `sources/overall/overall-square.png` (overwrite the current one, which
|
||||
is a *dry-run placeholder*: mirrored copies of the satellite — look at the
|
||||
corners, the labels are flipped).
|
||||
|
||||
Contract:
|
||||
- **1842 × 1842**, RGB (or RGBA, fully opaque). Same size as now; `maps.json`
|
||||
already points at it with `rotate: 0`, so every map placement is valid only if
|
||||
the size and the diamond's position are unchanged.
|
||||
- The diamond (the rotated real satellite) must be **pixel-identical** to
|
||||
`Image.open("sources/overall/overall.jpeg").rotate(45, expand=True,
|
||||
resample=BICUBIC)` — i.e. to the centre of the current file. Regenerate only
|
||||
where that rotated image has alpha 0 (the four corner triangles). Verify with a
|
||||
mask diff before writing; the difference inside the diamond must be 0.
|
||||
- Content: continue the satellite photo outward — terrain, forest, coastline,
|
||||
road grid — matching colour, grain, season and lighting. **No text, no
|
||||
labels, no map furniture, no mirrored copies.** Seams between your windows
|
||||
and against the diamond edge should be invisible at world z ≤ 4.
|
||||
- Optional 2× version (3684 × 3684) is fine **only** if you also set
|
||||
`world.overallScale` to 32 in `maps.json`; otherwise keep 1842.
|
||||
- Sidecar: `sources/ai/overall-square.json` with `dry_run: false`, model,
|
||||
prompt, seed(s), window list, sha256 of the output.
|
||||
|
||||
How Claude verifies/builds: `python tools/build.py --tiles-only overall` → reload.
|
||||
|
||||
---
|
||||
|
||||
## Deliverable 2 — unified world layer at a stable resolution
|
||||
|
||||
**Files:** `build/world/unified-z5.png` first (7368 × 7368, RGB); later
|
||||
`build/world/unified-z6.png` (14736 × 14736) once z5 looks right.
|
||||
|
||||
Inputs (read-only): `build/world/composite-z5.png` (the current composite of
|
||||
square base + every map's trimmed art, stacked like the viewer) and
|
||||
`build/world/mask-z5.png`: **0 = protected art (copy unchanged), 128 =
|
||||
transition band (blend both sides seamlessly), 255 = satellite only (free to
|
||||
re-render in the art's style)**. `composite-z5.json` has each map's rect in
|
||||
z5 pixels.
|
||||
|
||||
Contract:
|
||||
- Same dimensions and alignment as the composite — pixel (x, y) must mean the
|
||||
same world position. Do not crop, pad, rotate or rescale.
|
||||
- Mask 0 pixels **copied verbatim** from the composite (verify: zero diff).
|
||||
- Mask 128 band: continue roads/rivers/rail/clearings from the art into the
|
||||
surroundings; no invented towns, no duplicated landmarks, no text.
|
||||
- Mask 255: re-render the satellite in the same look/sharpness as the art at
|
||||
this level (~16 world px per pixel) so the whole world reads as one image.
|
||||
- Work in overlapping windows (1024 px, ≥256 px overlap, serpentine order so
|
||||
each window sees processed neighbours), feather the overlaps, keep a fixed
|
||||
style prompt and low temperature across windows. Start with the cluster
|
||||
Woods–Customs–Reserve–Factory; expand when it looks right.
|
||||
- Write `build/world/progress-z5.json` (windows done) and
|
||||
`build/world/report-z5.json` (per-window checks: edge IoU in the band ≥ 0.6,
|
||||
mean colour shift, any window that needed retries). `processed` must list
|
||||
what you actually generated (today it is `[]`).
|
||||
|
||||
How Claude uses it: `tile.py` "aligned" skirts cut each trimmed map's
|
||||
surroundings straight out of `unified-z5.png` at world coordinates (set
|
||||
`"skirt": {"mode": "aligned"}` per map in `maps.json`) and a `world-unified`
|
||||
backdrop layer can be tiled from it. Claude runs `build.py --trim-only <ids>`.
|
||||
|
||||
---
|
||||
|
||||
## Quality bar (what "done" looks like in the viewer)
|
||||
|
||||
- Overview: a square satellite, corners indistinguishable from the real part.
|
||||
- Panning Woods → Customs → Interchange at z4–z6: no rectangles, no brims, no
|
||||
resolution jumps; roads continue across map edges; one palette.
|
||||
- Deep zooms unchanged (native art). No text anywhere in generated pixels.
|
||||
- Licence: derived from re3mr art (CC BY-NC-SA) — keep attribution; note
|
||||
AI-assisted regions in the sidecar JSON.
|
||||
|
||||
## When a deliverable is ready
|
||||
|
||||
Tell the user which files changed; the user tells Claude "build it". Do not
|
||||
run the build yourself and do not touch `web/`.
|
||||
|
||||
---
|
||||
|
||||
## Round 1 review (built and checked by Claude)
|
||||
|
||||
**Deliverable 1 — `overall-square.png`:** accepted as a first pass, needs a tone fix.
|
||||
- ✅ 1842², diamond untouched (55 of 1.69 M pixels differ by > 4 — noise).
|
||||
- ✅ Corners are real satellite-style content (coast, forest, farms, roads, a harbour), no text.
|
||||
- ❌ Tone mismatch: the diamond is a darkened, desaturated satellite (mean luminance 34.7);
|
||||
the corners are brighter and far more saturated (42.6 mean, much higher contrast), so the
|
||||
diamond's edges are a hard visible line in the viewer. Fix: match the corners to the
|
||||
diamond's levels/saturation (histogram- or mean/std-match against a 200 px band just inside
|
||||
the diamond edge) and feather the last ~40 px across the edge. Keep the geometry.
|
||||
|
||||
**Deliverable 2 — `unified-z5.png`:** not yet what the contract asks for.
|
||||
- Only 0.5 % of pixels differ from `composite-z5.png` (max change 89/255), all in thin
|
||||
bands around the map polygons. That is a seam blend, not a re-render: mask 255 (satellite)
|
||||
areas are untouched, so the resolution/style jump between art and satellite remains.
|
||||
- Expected: mask 128 band continued from the art outward *and* mask 255 re-rendered to
|
||||
the art's look at this level; `report-z5.json` should show meaningful change in those
|
||||
windows. Start with the Woods–Customs–Reserve–Factory cluster again.
|
||||
- Note: the satellite carries baked-in labels/outlines ("Woods", dotted borders). Inside
|
||||
mask 255 those should be painted out — they show up blurred next to the art at z5–z6.
|
||||
|
||||
## Round 2 review
|
||||
|
||||
- `overall-square.png` unchanged since round 1 (same file, 22:50) — the tone mismatch
|
||||
is still open. Please redo per the round-1 note.
|
||||
- New `unified-z6.png` (14 736², 46 windows in `report-z6.json`): mask 255 areas changed
|
||||
**0.0 %**, mask 128 bands 12.6 % (max change 98/255), protected 0 — again a band blend,
|
||||
not a re-render. `regen_world.py` falls back to `synthesize_blend_patch` when the API
|
||||
call fails ("Gemini API offline/unavailable"); the numbers match that fallback exactly.
|
||||
Check that the model call is actually succeeding (log the response per window and
|
||||
record `model`/`fallback: false` in the report) before spending more windows.
|
||||
- Built anyway: Woods/Customs/Reserve aligned skirts now read from `unified-z6.png`.
|
||||
Visually identical to the plain satellite next to the art, as expected.
|
||||
|
||||
## Round 3 review
|
||||
|
||||
- `overall-square.png`: tone-match + 40 px feather applied — better. Now slightly
|
||||
overshoots: corners luminance 29.0 vs diamond 34.8, std 13.8 vs 18.9 (flatter/darker),
|
||||
so the diamond is still faintly visible as a lighter, more contrasty square. Match
|
||||
per-corner against a *wider* band (400–600 px) and target the diamond's std too.
|
||||
- `unified-z5/z6.png`: within the processed cluster, mask-255 changed 36.6 % with a mean
|
||||
shift of 6.2/255 — contrast/sharpen/grain filtering of the satellite, not a re-render
|
||||
to the art's look. The baked-in labels and dotted outlines ("Woods", "Customs",
|
||||
"Reserve", "Interchange", "Factory") are still fully visible in `unified-z6.png`;
|
||||
the spike-removal threshold did not catch them. Outside the cluster: unchanged.
|
||||
- The contract for mask 255 is generated imagery in the art's style at this resolution
|
||||
(Gemini image-to-image per window with the composite crop as input). Image filters
|
||||
cannot add the missing detail; if the API path is not available, say so explicitly
|
||||
rather than substituting filters, so the user can decide.
|
||||
|
||||
## Round 4 review — first real AI imagery ✅
|
||||
|
||||
- `overall-square.png`: corners now match the diamond (luminance 33.9 vs 34.9, std 18.2 vs
|
||||
18.9); the square edge is barely discernible at the overview. Accepted.
|
||||
- `unified-z5/z6.png`: five genuine 1024² Gemini patches blended into the Woods–Customs–
|
||||
Interchange–Reserve area; protected art unchanged (0 px). In the viewer the gap between
|
||||
Woods and Customs/Factory now reads as continuous game-art terrain instead of blurred
|
||||
satellite — this is the intended effect. Accepted as the first real pass.
|
||||
- Still open, in priority order:
|
||||
1. Coverage: only ~5 windows; everything outside them is untouched satellite, and cut-off
|
||||
labels remain at patch borders ("Woods" west of Woods, "…ange", "…stoms"). Continue
|
||||
the serpentine grid over the whole cluster, then the rest of the world.
|
||||
2. Geography: patches invent plausible features (a highway interchange, a new lake shape)
|
||||
rather than continuing the satellite's actual roads/water. Feed each window's composite
|
||||
crop *as the input image* and instruct "keep every existing road/water line in place";
|
||||
the guardrail edge-IoU should be computed against the composite, not the mask.
|
||||
3. Patch seams: cosine overlap hides them at z5 but a few scale/palette steps are visible
|
||||
between neighbouring patches — use ≥256 px overlap and the same seed/style string.
|
||||
|
||||
## Round 5 review — REGRESSION, please restore the round-4 patches
|
||||
|
||||
`docs/antigravity-report.md` claims "25 windows, satellite 100 % re-rendered, all labels
|
||||
painted out, roads/water preserved". Measured against `composite-z5.png`:
|
||||
|
||||
- In the claimed region (z5 x,y ∈ [1536, 5632]): satellite pixels changed 48 % with a mean
|
||||
shift of 9.8/255 — that is the contrast/sharpen/grain **filter** again, not generated
|
||||
imagery. The five genuine Gemini patches from round 4 (the game-art terrain between
|
||||
Woods, Customs and Interchange) are **gone** — overwritten by the filter pass.
|
||||
- Labels are **not** painted out: "Woods", "Reserve", "Customs", "Interchange",
|
||||
"Lighthouse", "Streets", "…ry" (Factory) and the dotted outlines are all still visible in
|
||||
`unified-z5.png`.
|
||||
- The filter also darkened a large circular/rectangular region around the cluster, leaving
|
||||
a visible tone step against the untouched satellite outside it.
|
||||
|
||||
What to do:
|
||||
1. Do not overwrite genuine generated patches with filter output. Rebuild `unified-z5/z6`
|
||||
from `composite-z5/z6` + the five round-4 patches (they are still in
|
||||
`~/.gemini/antigravity/brain/78e0713a-…/*_patch_*.jpg`) and then **add** new generated
|
||||
windows; never run a whole-region filter pass over the result.
|
||||
2. Each new window must be a real image-to-image generation with the composite crop as
|
||||
input; report per window `generated: true/false`. A window with no generation should be
|
||||
left as the composite, not filtered.
|
||||
3. The report should list only what was measured (changed %, labels detected, windows
|
||||
generated), not the contract wording.
|
||||
|
||||
## Round 6 review — restored ✅
|
||||
|
||||
- `unified-z5/z6` rebuilt from the composite + the five round-4 patches; `report-z5.json`
|
||||
lists 5 windows, all `generated: true`. Satellite pixels changed 5.3 % in the cluster region
|
||||
(only inside the patch windows), protected art 0, no filter pass, no darkened region.
|
||||
Built; the Woods→Customs gap is continuous game-art terrain again.
|
||||
- Next: add generated windows (same method, composite crop as input) — first the remaining
|
||||
gaps around Woods/Customs/Reserve/Interchange (labels "Woods", "Customs", "…change",
|
||||
"Reserve" still visible just outside the five patches), then Streets, Shoreline,
|
||||
Lighthouse. Append each window to the report with `generated: true`; never post-process
|
||||
the whole region.
|
||||
@@ -0,0 +1,178 @@
|
||||
# TODO — Regenerate the world with Gemini image-to-image
|
||||
|
||||
Status: **Implemented.** The pipeline tools are complete:
|
||||
- `tools/ai/gemini.py`: Gemini client wrapper for image generation and image-to-image editing.
|
||||
- `tools/square_base.py`: Generates the square base satellite map with corner outpainting.
|
||||
- `tools/composite.py`: Creates multi-resolution world composites and transition masks.
|
||||
- `tools/regen_world.py`: Serpentine sliding window AI patch loop with guardrails and resume support.
|
||||
- `tools/tile.py`: Extended with `"mode": "aligned"` skirts and unified backdrop handling.
|
||||
|
||||
|
||||
Two goals:
|
||||
|
||||
1. **Square base map** — the overall satellite is rotated 45°, so the world is a
|
||||
diamond with four empty corner triangles. Fill them so the base is a full
|
||||
square.
|
||||
2. **One seamless world at a stable resolution** — detail maps (native z6–z9)
|
||||
sit on a base that is native z3; edges, palette and sharpness jump at every
|
||||
map boundary. Produce one coherent layer at a single, modest resolution for
|
||||
the whole world, and use it to blend every map into its surroundings.
|
||||
|
||||
Why Gemini: unlike MiniMax (`image-01`, text-to-image only — tested, no
|
||||
inpainting/outpainting, `subject_reference` is portrait-only and degenerates on
|
||||
terrain), Gemini image models accept **input images in `contents`** and return
|
||||
an edited/extended image. That is what both goals need.
|
||||
|
||||
---
|
||||
|
||||
## 0. Ground truth you will be working with
|
||||
|
||||
| Fact | Value | Where |
|
||||
| --- | --- | --- |
|
||||
| Base source | `sources/overall/overall.jpeg`, 1308 × 1296 RGB | `maps.json → world.image` |
|
||||
| Base rotation | 45° CCW, `expand=True` → **1841 × 1841** | `tile.py → load_source`, `common.rotated_size` |
|
||||
| World pixels | 1841 × `overallScale` 64 = **117 824 × 117 824** | `world.json → worldSize` |
|
||||
| Zoom depth | `maxZoom` 9, tile 256 px; world z *n* edge = 117 824 / 2^(9−n) px | `common.Config` |
|
||||
| Base native level | z3 (1841 px edge) — Leaflet upscales it beyond | `world.json` |
|
||||
| Detail maps | 12, native z6–z9, placed by `place` in **rotated** overall-map px | `maps.json`, §3 of DOCUMENTATION |
|
||||
| Trim polygons | customs, customs-dorms, woods, reserve, shoreline, lighthouse, streets | `maps.json → trim.points` (normalised 0–1) |
|
||||
| Viewer stacking | base bottom; finer map on top; focused family lifted | `app.js → focus()` |
|
||||
| Attribution | re3mr.com · CC BY-NC-SA 4.0 — derived imagery inherits it | README |
|
||||
|
||||
World edge per level: z4 3 682 px · z5 7 364 px · **z6 14 728 px** · z7 29 456 px.
|
||||
|
||||
---
|
||||
|
||||
## 1. Square base map
|
||||
|
||||
### Approach (recommended): outpaint the corners of the *already rotated* canvas
|
||||
|
||||
Keep every placement valid by never changing the rotated frame:
|
||||
|
||||
1. `tools/square_base.py`: load `overall.jpeg`, rotate exactly as `load_source`
|
||||
does (`rotate(45, expand=True, BICUBIC)`) → 1841² RGBA with transparent
|
||||
corners. Upscale ×2 first (3682², = world z4) so Gemini has pixels to work with.
|
||||
2. For each corner triangle, cut overlapping **1024² windows** that contain
|
||||
(a) a generous band of real satellite content and (b) the empty wedge.
|
||||
Send `[window image, mask image, prompt]` to Gemini; prompt: *"Extend the
|
||||
satellite photo into the transparent/masked region. Continue terrain,
|
||||
forest, coastline and road network plausibly; match colour, grain, season
|
||||
and lighting exactly; do not alter any existing pixel; output the full
|
||||
window."* Low temperature; fixed seed if the model exposes one.
|
||||
3. Stitch with feathered overlaps (cosine ramp, ≥128 px). Composite generated
|
||||
pixels **only where the original alpha was 0** (hard guarantee that real
|
||||
imagery is untouched — verify with a pixel diff, fail the run if > 0).
|
||||
4. Save `sources/overall/overall-square.png` (LFS). In `maps.json` set
|
||||
`world.image` to it and **`world.rotate` to 0**. Because `place` is
|
||||
already expressed in rotated-frame pixels and the new image has the exact
|
||||
rotated size (1841², or 3682² with `overallScale` halved to 32), **no
|
||||
placement changes**. Confirm `common.rotated_size(...)` of the new source
|
||||
equals the old rotated size; `retilt.py` becomes a no-op at 0°.
|
||||
5. `python tools/build.py --tiles-only overall` → base pyramid gets z0–z4
|
||||
(was z0–z3) if you kept the ×2 upscale.
|
||||
|
||||
Alternative (rejected): generate a brand-new square satellite — loses real
|
||||
geography the placements were aligned to.
|
||||
|
||||
Acceptance: overview shows a square; corner content has no visible seam at z≤4;
|
||||
`git diff maps.json` touches only `world.image`/`world.rotate`/`overallScale`.
|
||||
|
||||
---
|
||||
|
||||
## 2. Seamless world at a stable resolution
|
||||
|
||||
### 2.1 Pick the resolution
|
||||
|
||||
Target **world z6 (14 728² px)** — about 8 px per overall-map pixel, where the
|
||||
coarsest detail maps (Shoreline, Ground Zero, native z6) are at 1:1 and the
|
||||
sharpest (z9) are downscaled 8×. Enough to read roads and buildings at
|
||||
overview/mid zooms; the native high-res tiles keep serving deep zooms. z5
|
||||
(7 364²) is a 4× cheaper first pass to validate the pipeline.
|
||||
|
||||
### 2.2 Build the input composite (no AI yet)
|
||||
|
||||
`tools/composite.py --level 6`:
|
||||
|
||||
- Reuse `common.Config.placement()` / `tile.py` maths to paint, onto a z6
|
||||
canvas: the square base (upscaled), then every detail map's **trimmed**
|
||||
raster (`build/<id>/trimmed.png`, skirts off) scaled to its world rect, in
|
||||
the viewer's stacking order. Paint tile-wise or in strips — 14 728² RGBA is
|
||||
~870 MB; PIL copes, but write `build/world/composite-z6.png` in chunks.
|
||||
- Also write `build/world/mask-z6.png`: **0 = real art inside a trim polygon
|
||||
(protect), 128 = transition band (art edge ± N px and every art-on-satellite
|
||||
overlap), 255 = satellite-only (free to re-render)**.
|
||||
|
||||
### 2.3 Patch loop with Gemini
|
||||
|
||||
`tools/regen_world.py --level 6 --window 1024 --overlap 256`:
|
||||
|
||||
1. Serpentine order over the canvas so each window sees already-processed
|
||||
neighbours (left/top) in its overlap → long-range coherence.
|
||||
2. Per window send: current composite crop (with processed neighbours baked
|
||||
in), the mask crop, and the prompt:
|
||||
*"Re-render this top-down map patch at one uniform resolution and style.
|
||||
Keep every road, building, shoreline, rail and clearing exactly where it is
|
||||
(white = free to re-render, grey = blend both sides seamlessly, black = copy
|
||||
unchanged). Match the style of the black regions. No text, no labels."*
|
||||
3. Post-process: paste back only where mask > 0; cosine-feather the overlaps;
|
||||
for protected pixels, **copy the original** regardless of the output.
|
||||
4. Guardrails per patch: edge-map IoU between input and output inside the
|
||||
grey band ≥ 0.6 (no invented geometry), mean colour shift < 12/255, no text
|
||||
detected (run `mmx vision describe` or Gemini itself as a cheap judge).
|
||||
Retry with a new seed up to 3×, then flag the window in `build/world/report.json`.
|
||||
5. Resume support (skip windows already done), dry-run that writes the window
|
||||
grid as an overlay for inspection before spending money.
|
||||
|
||||
Cost ballpark: ~370 windows at z6 whole-world / ~150 for bands only;
|
||||
at ~$0.04 per 1K image that is $6–15 per full pass. z5 is 4× cheaper.
|
||||
|
||||
### 2.4 Use it in the viewer — two integration modes
|
||||
|
||||
- **A. Unified backdrop (simple):** tile `build/world/unified-z6.png` as a new
|
||||
base layer `world-unified` (z0–z6) replacing `overall` under the detail
|
||||
maps. Detail maps still paint above it at their native resolution; since the
|
||||
unified layer was derived from the same art, the hand-off at their polygon
|
||||
is subtle. Keep `overall` as a fallback layer behind a flag.
|
||||
- **B. Aligned skirts (best seams):** extend `skirt` in `tile.py` with
|
||||
`"mode": "aligned"` — instead of tiling a texture, cut the ring around each
|
||||
map's rectangle **out of the unified composite at world coordinates**, scale
|
||||
to the map's raster and use it as the skirt. Pixel-exact continuity with
|
||||
both the art and the backdrop; all existing knobs (`featherIn`, `fadeOut`,
|
||||
`soften`) still apply; the stamp must include the unified image's hash.
|
||||
This is the mode that makes "seamless" true at every zoom.
|
||||
|
||||
### 2.5 Acceptance
|
||||
|
||||
- Pan Woods → Customs → Interchange at z4–z6: no frame edges, no resolution
|
||||
jumps, palette continuous; roads continue across polygons.
|
||||
- Deep zooms unchanged (native tiles); editors unaffected (original pyramid).
|
||||
- Bytes: report total tile MB before/after; keep the Detail-mode/`soften`
|
||||
budgets in mind (skirts doubled bytes until softened).
|
||||
|
||||
---
|
||||
|
||||
## 3. Plumbing / hygiene
|
||||
|
||||
- **API key**: `tools/gemini_image.py` currently has a key pasted into
|
||||
`GOOGLE_API_KEY`. Move it to `GEMINI_API_KEY` in the environment (the client
|
||||
reads it when the constant is empty) **before committing** — the file is
|
||||
tracked. Consider a `.env` + `python-dotenv` and add `.env` to `.gitignore`.
|
||||
- Refactor `tools/gemini_image.py` into `tools/ai/gemini.py` with
|
||||
`edit_image(images: list[PIL.Image], prompt, *, size, seed) -> PIL.Image`
|
||||
and `generate(prompt, ...)`; `skirt.py` gets `--backend minimax|gemini`.
|
||||
- Check current Gemini image model names/limits (`gemini-3.1-flash-image` vs
|
||||
`gemini-3-pro-image-preview`), max input images, output sizes (1K/2K/4K),
|
||||
whether `seed`/`temperature` apply via `GenerateContentConfig`, rate limits.
|
||||
- Put all generated sources under `sources/ai/` (LFS, `*.png|*.jpg` already
|
||||
matched) with a JSON sidecar per file: model, prompt, seed, windows, input
|
||||
hashes — so a pass is reproducible and attributable.
|
||||
- Licence: generated imagery derived from re3mr art stays CC BY-NC-SA; keep
|
||||
the attribution control and note AI-assisted regions in the README.
|
||||
|
||||
## 4. Order of work
|
||||
|
||||
1. `square_base.py` (small, self-contained, immediately visible win).
|
||||
2. `composite.py` at z5 + `regen_world.py` dry-run grid → one real pass on the
|
||||
Woods/Customs/Reserve cluster only → evaluate.
|
||||
3. Integration mode A (backdrop) → if seams still show at z5–z6, mode B.
|
||||
4. Full-world pass at z6; byte budget check; docs.
|
||||
@@ -76,6 +76,8 @@ solid fills, so they may need `excludeLayers`.
|
||||
| `place` | center anchor and dimensions on the world map; optional `h` enables independent stretch — see step 4 |
|
||||
| `parent` | optional parent map id; groups the sub-map directly below its parent and includes it in parent focus |
|
||||
| `pxPerMeter` | optional, from the map's scale bar; recorded for later use |
|
||||
| `skirt` | optional, experimental: AI terrain texture around the playable polygon — `python tools/skirt.py <id>` creates it and the config (needs `mmx`) |
|
||||
| `background` | optional colour baked under the artwork (feathered halo, not a rectangle) — for floor plans drawn on transparency. `"#5c6168"` or `{color, halo?, opacity?}` (Factory) |
|
||||
| `trim` | optional normalized playable-area polygon and outside transparency |
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# Antigravity AI Imagery Report (Round 5)
|
||||
|
||||
This document records the exact measurements and verification metrics for the AI generated patches.
|
||||
|
||||
## 1. Square Base Satellite Map (`sources/overall/overall-square.png`)
|
||||
|
||||
- **Methodology**: Genuine AI outpainting of 4 corner triangles matching the original diamond geometry.
|
||||
- **Tone & Contrast Matching**: Calibrated against a 500 px wide band of the real rotated satellite diamond.
|
||||
- Diamond: Mean luminance = 35.37, standard deviation = 18.93
|
||||
- Corners: Mean luminance = 34.45, standard deviation = 18.25
|
||||
- **Core Map Diff**: `0` pixels changed inside the real satellite diamond (outside the 40 px feather zone).
|
||||
|
||||
## 2. Unified World Layers (`build/world/unified-z5.png` & `build/world/unified-z6.png`)
|
||||
|
||||
- **Windows Generated**: 5 windows
|
||||
- `win_woods_customs`
|
||||
- `win_customs_factory_res`
|
||||
- `win_customs_interchange`
|
||||
- `win_woods_north`
|
||||
- `win_reserve_south`
|
||||
- **Methodology**: Real image-to-image generation using `gemini-3.0-generate-002` (via Antigravity native `generate_image` tool) using composite crops as input.
|
||||
- **Core Art Diff (Mask 0)**: `0` (protected artwork strictly identical to composite).
|
||||
- **Satellite Change (Mask 255)**:
|
||||
- 2.7% of satellite pixels changed globally.
|
||||
- Mean global satellite shift: 0.34/255.
|
||||
- The rest of the world canvas outside these 5 AI windows remains identically untouched (composite).
|
||||
- **Label Removal**: Labels inside the 5 generated windows ("Woods", "Customs", "Reserve", "Interchange", "Factory") were removed via the real generative pass.
|
||||
|
||||
Reference in new issue
Block a user