Skip to content

PixelForge AI v0.9.7

Choose a tag to compare

@Suturobery Suturobery released this 01 Dec 08:51
· 19 commits to main since this release

What's New in v0.9.7

Accurate Pixel Conversion & Auto-Centering (External AI Agents, IDEs & Imports)

  • Dark Outlines Preserved on Transparent PNGs: Added detectOpaqueBorderColor() in normalizeV2 so already-transparent PNGs never fall back to [0, 0, 0] black and accidentally strip dark 1px pixel-art outlines; threaded alphaThreshold and true pre-removal borderColor through every pipeline stage.
  • No More Slightly-Oversized Half-Size Cliff: Sprites slightly larger than canvas bounds (e.g., 34×34 on 32×32) now fit cleanly and centered instead of halving to 17×17, and large downscale blocks are gated against single-pixel silhouette bloat.
  • Auto-Convert & Auto-Center Across AI/IDE Tools:
    • import_image_as_layer now defaults to fit="auto" (1:1 verbatim on exact match; automatic pixel conversion + aspect-preserving centering on mismatched dimensions; pass fit="exact" to reject mismatches).
    • import_and_normalize_image enables strayCleanup="normal" by default and exposes alphaThreshold and strayCleanup.
    • resize_canvas, UI resizeCanvas (now fully undoable via canvas.resize), and scale_sprite all default to anchor="center". center_content also accounts for and shifts editable cel.vectors.
  • Broader PNG & VFX Accuracy: decodePng now supports 1/2/4/8/16-bit indexed & grayscale PNGs plus RGB/grayscale tRNS transparency; drag-and-drop image import runs deterministic normalizeV2; VFX downsampling preserves aspect ratio, centers cleanly, and uses premultiplied alpha in soft mode.

Dynamic Viewport Scaling & Safe-Area Centering (0 / Ctrl+0)

  • Unobstructed Safe-Area Fit: Added pure viewport math (src/lib/pixelforge/viewport.ts) that fits and centers canvases cleanly clear of PalettePanel and HUD bars inside useLayoutEffect (zero 1-frame stale-zoom flash).
  • Smooth Scaling for Small & Large Canvases: Removed the Math.floor(< 1) === 0 → 0.25× collapse on large canvases (256×256 / 512×512) and added quarter-step zoom (1×–2×) alongside crisp integer zoom (≥ 2×).
  • Smarter Zoom & Auto-Pan: Preserves user zoom/pan when resizing docks or windows, anchors keyboard +/- zoom at safe-area center, anchors touch pinch-zoom at the two-finger midpoint, adds 0 / Ctrl+0 Fit & Center shortcut, and prevents Smart AI Auto-Pan from pushing centered visible canvases off-screen.

High-Performance Canvas, Tiles & AI Drawing

  • Viewport-Bounded GPU Canvas: Clipped CanvasStage backing store to the visible viewport when scaled dimensions exceed 2048px and capped AiLiveCanvasOverlay (≤ 2048px), keeping GPU memory O(viewport) even at 256×256 @ 64× zoom, with visible-range grid culling, low-zoom tile grids, cached tile-stamp ghost canvases, and aligned Mirror X/Y tile stamping.
  • Single-Canvas Tileset Picker & Fast Level Mockup: Replaced up to 1,024 individual <TileThumb> DOM <canvas> elements with a single-canvas TilesetSheetCanvas, paused background compositing/animation when hidden, switched to single-frame compositing + preSliced reuse, added patchLevelMockupCell, cached room base & ghost canvases, and fixed nested setState in applyRoomCell.
  • Faster AI Agent Drawing: Coalesced store, timelapse, and mcp-bridge updates inside bus.inTransaction, skipped redundant per-step SHA-256/buildCraftGate/localStorage work on inner batch steps, reused composited buffers for Auto-Eyes PNGs, fixed the async finishToolReview race, and rewrote diffChangedPixels with a zero-allocation Uint32Array serpentine pass.

Bug Prevention & Full Documentation Sync

  • Preserved cel.vectors across replaceCelBuffer and brush strokes; fixed out-of-bounds ellipse squashing in drawEllipsePixels; fixed selectionScaleTo origin-only drags; fixed mcp-follow clip-switch frame index; fixed renderFrameScaled non-square thumbnail stretching.
  • Audited and updated README.md and all 10 guides in docs/ to accurately reflect v0.9.7 (111 Full / 28 Compact tools, L0/L1/L2 tier counts, all 15 previously undocumented tools, 13 tools & shortcuts, 8–64px tiles, multi-OS releases, and current test suites).

Desktop installers (Windows .exe, macOS .dmg/.zip, Linux .AppImage) and update manifests are built automatically by GitHub Actions and attached to this release.