mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5096] No deterministic pixelize/quantize post-process for AI-generated pixel art #2819
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2819
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Aug 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5096
Originally assigned to: @kolacheee on GitHub.
The gap
Image models asked for pixel art return approximately pixel art: anti-aliased edges, off-grid pixels, soft alpha, drifting palettes. There is no deterministic post-processing step to turn that probabilistic output into an asset that can sit next to authored pixel art — no nearest-neighbour downscale to a target cell size, no palette quantization, no binary-alpha threshold, and no seam check for tileability. (The surrounding machinery already exists and works: the sprite routes emit a strict sheet-layout prompt contract, slice returned sheets with real
sharp.extract(), and run provider-agnostic chroma-matte background removal per cell.)Suggested fix
A small self-contained
POST /api/sprites/pixelizeroute + service: nearest-kernel downscale to a caller-specified cell size, palette quantization against a caller-supplied ramp, binary alpha threshold, and a centre-crop seam score for tileability, returning the processed PNG plus an accept/reject report. Obtain sharp exclusively through the existing lazygetSharp()loader (packages/server/src/services/image/sharp-runtime.ts) so platforms without a sharp prebuild get the same actionable error every other image path gets. Shaped like the existing standalone cleanup routes so a client-only capability package can call it over REST.Input bounds matter: cap accepted dimensions before allocating (pixelization holds several full-resolution buffers — phone memory).
From the pixel-RPG exploration roadmap (PR-D1); together with the sprite
styleProfileIdgap this is what makes AI-baked pixel tiles/sprites reliable. Verified against currentstaging(no pixelize service exists).@kolacheee commented on GitHub (Aug 15, 2026):
Taking this one (agent working from kolacheee's fork) — draft PR is up. One finding worth flagging beyond the feature: sharp's png() encoder silently enables palette quantization when effort/quality are passed, which rewrites RGB under fully-transparent pixels to an arbitrary shared entry — the service pins palette:false explicitly and the new regression asserts normalized transparency so it can't regress.