[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111839":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":36,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":15,"starSnapshotCount":15,"syncStatus":40,"lastSyncTime":41,"discoverSource":42},111839,"xprite-pixelate","rhinoc\u002Fxprite-pixelate","rhinoc","Recover the real pixel grid of AI-generated and upscaled pixel art, and turn images into pixel art.","https:\u002F\u002Fxprite.cc",null,"TypeScript",90,7,1,0,8,34,4,52.11,"MIT License",false,"main",[24,25,26,27,28,29,30,31,32,33,34,35],"ai-pixel-art","computer-vision","game-dev","generative-ai","grid-detection","image-processing","pixel-art","pixel-art-converter","pixelate","sprites","typescript","webassembly","2026-11-06 13:56:27","2026-11-22 20:59:33","# @xprite\u002Fpixelate\n\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002F@xprite\u002Fpixelate)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@xprite\u002Fpixelate)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-blue.svg)](LICENSE)\n\nEnglish | [简体中文](https:\u002F\u002Fgithub.com\u002Frhinoc\u002Fxprite-pixelate\u002Fblob\u002Fmain\u002FREADME.zh-CN.md)\n\nRecover the real pixel grid of AI-generated pixel art and get back one clean pixel per cell. It\nalso turns ordinary images into pixel art. It runs in browsers and Node, has no runtime\ndependencies, and is the importer of the [Xprite](https:\u002F\u002Fxprite.cc) pixel editor.\n\n## Compared with other tools\n\nA real generated image (887×887, cells 15 to 21 px wide), recovered by each tool with its default\nsettings. Xprite puts each cut on a colour edge, so it does not cut through the eye, the boots or\nthe sword.\n\n| Recovered grid | Xprite, 48×49 | [pixel-art-fixer](https:\u002F\u002Fgithub.com\u002FRetro-Diffusion\u002Fpixel-art-fixer), 47×48 | [perfectPixel](https:\u002F\u002Fgithub.com\u002Ftheamusing\u002FperfectPixel), 50×50 | [proper-pixel-art](https:\u002F\u002Fgithub.com\u002FKennethJAllen\u002Fproper-pixel-art), 53×54 | [Sprite Fusion Pixel Snapper](https:\u002F\u002Fgithub.com\u002FHugo-Dz\u002Fspritefusion-pixel-snapper), 56×53 |\n| :---: | :---: | :---: | :---: | :---: | :---: |\n| ![Grid](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fgriffith-mesh.png) | ![Xprite](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fgriffith-xprite.png) | ![pixel-art-fixer](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fgriffith-fixer.png) | ![perfectPixel](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fgriffith-perfectpixel.png) | ![proper-pixel-art](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fgriffith-proper.png) | ![Sprite Fusion](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002F732237d34dfed3f9cc54d51b6c12ed5121c0978b\u002Fdocs\u002Fimages\u002Fgriffith-spritefusion.png) |\n\nOn the AI suite of [our benchmark](#benchmark) (1746 cases), Xprite gets the exact size most\noften:\n\n| Method | Exact size | Within 1 cell | Pixel match | Fringe (alpha 1–254) | Median time |\n| --- | --- | --- | --- | --- | --- |\n| Xprite Auto | **83.6%** | **90.0%** | **99.7%** | 0.1% | 2.80 s |\n| pixel-art-fixer | 49.7% | 80.9% | 98.3% | 0.0% | 0.18 s |\n| perfectPixel | 53.3% | 68.0% | 96.7% | - | 0.03 s |\n| proper-pixel-art | 72.2% | 80.4% | 99.7% | 0.0% | 0.49 s |\n| Sprite Fusion Pixel Snapper | 56.8% | 77.9% | 98.5% | 91.0% | — |\n\n## Contents\n\n- [Examples](#examples)\n- [Install](#install)\n- [Usage](#usage)\n- [How it works](#how-it-works)\n- [Benchmark](#benchmark)\n- [License](#license)\n\n## Examples\n\nEach example is one case from a category of the benchmark's AI suite: CC0 pixel art rendered the\nway generators fake it, with a known native size. The sizes are the visible art in cells; ✅ marks\nthe exact native size. Every tool runs with its default settings.\n\n### Two sprites on one canvas\n\n- [Goblins by LuizMelo](https:\u002F\u002Fluizmelo.itch.io\u002Fmonsters-creatures-fantasy), CC0. Category `gen_pair`. Native art: 78×36.\n\n| Input, 1800×845 | Xprite, 78×36 ✅ | pixel-art-fixer, 78×35 ❌ | perfectPixel, 80×36 ❌ | proper-pixel-art, 79×36 ❌ | Sprite Fusion, 78×36 ✅ |\n| :---: | :---: | :---: | :---: | :---: | :---: |\n| ![Input, 1800×845](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpair-input.png) | ![Xprite](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpair-xprite.png) | ![pixel-art-fixer](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpair-fixer.png) | ![perfectPixel](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpair-perfectpixel.png) | ![proper-pixel-art](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpair-proper.png) | ![Sprite Fusion](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002F732237d34dfed3f9cc54d51b6c12ed5121c0978b\u002Fdocs\u002Fimages\u002Fpair-spritefusion.png) |\n\n### Cells that drift and jitter\n\n- [Boss dragon by ansimuz](https:\u002F\u002Fopengameart.org\u002Fcontent\u002Fsideview-fantasy-patreon-collection), CC0. Category `gen_wobble`. Native art: 71×39.\n\n| Input, 1226×664 | Xprite, 71×39 ✅ | pixel-art-fixer, 69×38 ❌ | perfectPixel, 74×39 ❌ | proper-pixel-art, 69×38 ❌ | Sprite Fusion, 71×38 ❌ |\n| :---: | :---: | :---: | :---: | :---: | :---: |\n| ![Input, 1226×664](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwobble-input.png) | ![Xprite](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwobble-xprite.png) | ![pixel-art-fixer](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwobble-fixer.png) | ![perfectPixel](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwobble-perfectpixel.png) | ![proper-pixel-art](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwobble-proper.png) | ![Sprite Fusion](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002F732237d34dfed3f9cc54d51b6c12ed5121c0978b\u002Fdocs\u002Fimages\u002Fwobble-spritefusion.png) |\n\n### Small cells and WebP damage\n\n- [Monster by Denzi](https:\u002F\u002Fopengameart.org\u002Fcontent\u002Fdenzis-public-domain-art), CC0. Category `gen_small_pitch`. Native art: 32×48.\n\n| Input, 218×339 | Xprite, 32×48 ✅ | pixel-art-fixer, 32×47 ❌ | perfectPixel, 32×49 ❌ | proper-pixel-art, 34×49 ❌ | Sprite Fusion, 32×48 ✅ |\n| :---: | :---: | :---: | :---: | :---: | :---: |\n| ![Input, 218×339](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsmall-input.png) | ![Xprite](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsmall-xprite.png) | ![pixel-art-fixer](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsmall-fixer.png) | ![perfectPixel](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsmall-perfectpixel.png) | ![proper-pixel-art](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsmall-proper.png) | ![Sprite Fusion](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002F732237d34dfed3f9cc54d51b6c12ed5121c0978b\u002Fdocs\u002Fimages\u002Fsmall-spritefusion.png) |\n\n### A small sprite on a large clear canvas\n\n- [Nekomimi girl by cawfeecrow](https:\u002F\u002Fopengameart.org\u002Fcontent\u002Fnekomimi-girl-portrait), CC0. Category `gen_sparse`. Native art: 123×136.\n\n| Input, 1797×1800 | Xprite, 123×136 ✅ | pixel-art-fixer, 122×136 ❌ | perfectPixel, 124×136 ❌ | proper-pixel-art, 127×142 ❌ | Sprite Fusion, 118×133 ❌ |\n| :---: | :---: | :---: | :---: | :---: | :---: |\n| ![Input, 1797×1800](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsparse-input.png) | ![Xprite](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsparse-xprite.png) | ![pixel-art-fixer](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsparse-fixer.png) | ![perfectPixel](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsparse-perfectpixel.png) | ![proper-pixel-art](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fsparse-proper.png) | ![Sprite Fusion](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002F732237d34dfed3f9cc54d51b6c12ed5121c0978b\u002Fdocs\u002Fimages\u002Fsparse-spritefusion.png) |\n\n### An off-white background\n\n- [Dragon by ansimuz](https:\u002F\u002Fopengameart.org\u002Fcontent\u002Fsideview-fantasy-patreon-collection), CC0. Category `gen_white`. Native art: 162×106.\n\n| Input, 1800×1210 | Xprite, 162×106 ✅ | pixel-art-fixer, 325×208 ❌ | perfectPixel, 161×105 ❌ | proper-pixel-art, 168×106 ❌ | Sprite Fusion, 162×106 ✅ |\n| :---: | :---: | :---: | :---: | :---: | :---: |\n| ![Input, 1800×1210](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwhite-input.png) | ![Xprite](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwhite-xprite.png) | ![pixel-art-fixer](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwhite-fixer.png) | ![perfectPixel](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwhite-perfectpixel.png) | ![proper-pixel-art](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fwhite-proper.png) | ![Sprite Fusion](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002F732237d34dfed3f9cc54d51b6c12ed5121c0978b\u002Fdocs\u002Fimages\u002Fwhite-spritefusion.png) |\n\n### Painterly shading inside cells\n\n- [Naga mage, Dungeon Crawl Stone Soup](https:\u002F\u002Fgithub.com\u002Fcrawl\u002Ftiles), CC0. Category `gen_painterly`. Native art: 31×32.\n\n| Input, 411×425 | Xprite, 31×32 ✅ | pixel-art-fixer, 30×33 ❌ | perfectPixel, 31×32 ✅ | proper-pixel-art, 31×34 ❌ | Sprite Fusion, 31×32 ✅ |\n| :---: | :---: | :---: | :---: | :---: | :---: |\n| ![Input, 411×425](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpainterly-input.png) | ![Xprite](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpainterly-xprite.png) | ![pixel-art-fixer](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpainterly-fixer.png) | ![perfectPixel](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpainterly-perfectpixel.png) | ![proper-pixel-art](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002Fmain\u002Fdocs\u002Fimages\u002Fpainterly-proper.png) | ![Sprite Fusion](https:\u002F\u002Fraw.githubusercontent.com\u002Frhinoc\u002Fxprite-pixelate\u002F732237d34dfed3f9cc54d51b6c12ed5121c0978b\u002Fdocs\u002Fimages\u002Fpainterly-spritefusion.png) |\n\n## Install\n\n```bash\nnpm install @xprite\u002Fpixelate\n```\n\n## Usage\n\nAn image is `{ width, height, data }`, where `data` holds RGBA bytes, row by row, with straight\nalpha. `ImageData` from a canvas has this shape.\n\n### Recover a grid\n\n```ts\nimport {\n  CellColorPicker,\n  PixelationAlgorithm,\n  PixelationMode,\n  detectWithAlgorithm,\n  pixelateImage,\n  preloadWasm,\n} from \"@xprite\u002Fpixelate\";\n\nawait preloadWasm(); \u002F\u002F optional: loads the grid-count detector once, before the first image\n\nconst image = { width, height, data: new Uint8ClampedArray(rgba) };\n\nconst grid = detectWithAlgorithm(image, PixelationAlgorithm.Auto);\nif (grid.reliable) {\n  const art = pixelateImage(image, {\n    mode: PixelationMode.RecoverGrid,\n    grid,\n    colorPicker: CellColorPicker.TwoStage,\n    paletteSnap: { adaptive: true }, \u002F\u002F merge the near-shades a generator leaves behind\n  });\n  \u002F\u002F art.width × art.height is the native size: one pixel per recovered cell.\n}\n```\n\n`grid.reliable` is false when the image has no consistent grid (a photo, a drawing, or real 1×\npixel art). `RecoverGrid` mode throws an error for such a grid. Use `Convert` mode for those\nimages.\n\n### Convert an image\n\n```ts\nconst art = pixelateImage(photo, {\n  mode: PixelationMode.Convert,\n  targetSize: { width: 64, height: 64 },\n  paletteSnap: { colors: 16 },\n});\n```\n\n### Remove a flat background\n\n```ts\nimport { removeBackground } from \"@xprite\u002Fpixelate\";\n\nconst clear = removeBackground(image); \u002F\u002F keys the most common border colour\n```\n\nCall it before detection when a generator painted a white or checkerboard background.\n\n### Options\n\n`pixelateImage(image, options)`:\n\n| Option | Description |\n| --- | --- |\n| `mode` | `RecoverGrid` uses a detected grid. `Convert` makes pixel art at a size you give. |\n| `grid` | A grid from `detectWithAlgorithm`. If you omit it, the grid is detected with `algorithm`. |\n| `algorithm` | Grid detector. `Auto` runs all of them and picks one grid. |\n| `colorPicker` | Colour rule per cell: `TwoStage`, `MostCommon` (default), `Median`, `Average`, `KMeans`, `Contrast` and others. |\n| `targetSize`, `targetWidth`, `targetHeight`, `blockSize` | Output size in `Convert` mode. |\n| `paletteSnap` | Limit colours: `{ adaptive: true }`, `{ colors: 16 }` or `{ palette: [...] }`, with optional `dither`. |\n| `prepass` | Outline pre-pass from PixelOE (`Pixeloe`, `PixeloeLines`). |\n| `removeNoise` | Light smoothing of similar neighbour colours. |\n| `preserveDimensions` | Scale the result back up to the source size, nearest neighbour. |\n\n[`src\u002Ftypes.ts`](src\u002Ftypes.ts) documents every option.\n\n### Workers\n\n`detectWithAlgorithm` and `pixelateImage` are synchronous and can take a few seconds on large\nimages, so run them in a Web Worker. In a browser, Auto can also run its grid-count detector in a\nnested worker, in parallel with the other detectors:\n\n```ts\nimport { setAcRlBrowserWorkerFactory, detectWithAlgorithmAsync } from \"@xprite\u002Fpixelate\";\n\nsetAcRlBrowserWorkerFactory(\n  () =>\n    new Worker(\n      new URL(\"@xprite\u002Fpixelate\u002Fwasm\u002Fac-rl-detect-browser-worker.js\", import.meta.url),\n      { type: \"module\" },\n    ),\n);\nconst grid = await detectWithAlgorithmAsync(image);\n```\n\nIn Node, the detector starts a `worker_threads` worker from `wasm\u002Fac-rl-detect-worker.mjs` by\nitself. Set `XPRITE_AC_RL_WORKER=0` to keep it on the calling thread.\n\n## How it works\n\n1. **Straighten.** Auto estimates the tilt. When the tilt is clear, it detects on a straightened\n   copy.\n2. **Propose.** Seven detectors propose grids: uniform grid, edge grid, frame lattice, pitch\n   lattice, colour period, border runs and edge spacing. A WebAssembly port of pixel-art-fixer's\n   autocorrelation and run-length vote gives an independent cell count.\n3. **Follow the edges.** At each pitch the detectors keep, a dynamic program walks each axis and\n   puts every cut on a colour edge. Each cell stays within 0.75 to 1.25 of the pitch, and a change\n   of width costs extra. This step handles cells of uneven width.\n4. **Filter.** A candidate is dropped when its cuts miss the colour edges that a coarser grid\n   follows.\n5. **Choose.** The grid that describes the image in the fewest bits wins (minimum description\n   length). A grid that is not locked to the content's phase pays a penalty. Drift and sheared\n   rows are read as strip shifts or as a phase field.\n6. **Sample.** Each cell gets one colour (`TwoStage` packs the cell's colours in two steps).\n   Adaptive palette snapping then merges near-duplicate shades.\n7. **Settle alpha.** Cells that the art covers become fully opaque, and cells outside the art\n   become clear.\n\nEach source file in [`src\u002F`](src) describes its step.\n\n## Benchmark\n\n[`bench\u002F`](bench) compares this package with four other tools on mostly CC0 native pixel art (plus one CC-BY source). The\nbenchmark damages the art in known ways and scores each result against the original. Every tool\nruns with its default settings.\n\nAI suite (1746 cases in 12 categories, rendered the way generators fake pixel art):\n\n| Method | Exact size | Within 1 cell | Pixel match | ΔE | Fringe (alpha 1–254) | Median time |\n| --- | --- | --- | --- | --- | --- | --- |\n| Xprite Auto | **83.6%** | **90.0%** | **99.7%** | 0.85 | 0.1% | 2.80 s |\n| pixel-art-fixer | 49.7% | 80.9% | 98.3% | 1.74 | 0.0% | 0.18 s |\n| perfectPixel | 53.3% | 68.0% | 96.7% | 2.42 | - | 0.03 s |\n| proper-pixel-art | 72.2% | 80.4% | 99.7% | **0.64** | 0.0% | 0.49 s |\n| Sprite Fusion Pixel Snapper | 56.8% | 77.9% | 98.5% | 1.93 | 91.0% | — |\n\nExact size per category:\n\n| Category | Xprite | pixel-art-fixer | perfectPixel | proper-pixel-art | Sprite Fusion |\n| --- | --- | --- | --- | --- | --- |\n| Clean (`gen_clean`) | **93.6%** | 71.7% | 58.4% | 74.6% | 56.6% |\n| Sparse canvas (`gen_sparse`) | **99.0%** | 63.5% | 71.9% | 88.5% | 69.8% |\n| Off-white background (`gen_white`) | 77.7% | 65.2% | 66.1% | **82.1%** | 78.6% |\n| Soft outline (`gen_soft_edge`) | **95.8%** | 61.9% | 67.8% | 82.2% | 59.3% |\n| Drift and WebP (`gen_webp`) | **80.9%** | 40.5% | 57.8% | 71.1% | 48.6% |\n| Halos and JPEG (`gen_halo_jpeg`) | **82.7%** | 52.6% | 60.1% | 72.8% | 59.0% |\n| Painterly shading (`gen_painterly`) | **84.5%** | 39.1% | 67.8% | 79.3% | 50.0% |\n| Small cells (4-8 px) (`gen_small_pitch`) | **72.2%** | 47.9% | 40.2% | 43.8% | 42.6% |\n| Large cells (24-48 px) (`gen_large_pitch`) | 68.2% | 22.0% | 68.2% | **78.0%** | 57.8% |\n| Strong drift (`gen_wobble`) | **73.3%** | 30.8% | 30.8% | 54.1% | 49.4% |\n| Two sprites (`gen_pair`) | **97.1%** | 62.7% | 45.1% | 72.5% | 60.8% |\n| Drop shadow (`gen_shadow`) | **97.3%** | 64.0% | 0.0% | 84.7% | 68.5% |\n\n[pixel-bench](https:\u002F\u002Fgithub.com\u002FRetro-Diffusion\u002Fpixel-bench) suite v1 (7651 cases of upscales and\nlossy pipelines):\n\n| Method | Exact size | Within 1 cell | Pixel match | ΔE | Median time |\n| --- | --- | --- | --- | --- | --- |\n| Xprite Auto | **87.1%** | **90.1%** | 94.4% | **2.76** | 0.27 s |\n| pixel-art-fixer | 77.8% | 83.5% | **94.4%** | 2.83 | 0.04 s |\n| perfectPixel | 24.2% | 32.9% | 89.7% | 4.31 | 0.002 s |\n| proper-pixel-art | 16.5% | 28.6% | 93.0% | 3.85 | 0.05 s |\n| Sprite Fusion Pixel Snapper | 6.6% | 26.8% | 91.0% | 4.42 | — |\n\nPixel match, ΔE and fringe are measured only on each method's exact-size cases. The sample sets can differ, so these values are not directly comparable across methods. Fringe counts alpha values from 1 to 254, including nearly opaque pixels.\n\nEach method uses its default color processing, so these are end-to-end results with different palettes. Timing methods also differ; measurements that include process startup and PNG I\u002FO are omitted from the table. Results use the same cases and scoring code; some were recorded in an earlier run. Synthetic damage does not establish real-world success rates. See [bench\u002FREADME.md](bench\u002FREADME.md) for method versions, timing and reproduction.\n\n## License\n\nMIT. Parts are adapted from pixel-art-fixer, PixelOE, proper-pixel-art and tensorhead\u002Fdithering\n(see [NOTICE.md](NOTICE.md)). The example art is CC0 (see\n[bench\u002Fcorpus\u002FCREDITS.md](bench\u002Fcorpus\u002FCREDITS.md)).\n","Xprite Pixelate 是一个用于恢复 AI 生成或放大后的像素画真实像素网格，并将普通图像转换为高质量像素艺术的工具。其核心功能包括智能网格检测（基于边缘对齐而非均匀分割）、高精度像素还原（在基准测试中83.6%案例精确识别原生尺寸）以及跨平台运行能力（支持浏览器与 Node.js，无外部依赖，可选 WebAssembly 加速）。技术上融合计算机视觉与图像处理算法，专为保留角色细节（如眼睛、武器轮廓）而优化。适用于游戏开发中的像素精灵修复、AI 生成像素图后处理、复古风格美术资源重建等场景。",2,"2026-11-24 04:41:56","CREATED_QUERY"]