Pixel Art Upscaler
Operator: Abdulla Al Fahad. How tools are built and checked
Stretching a 16 × 16 sprite with a normal image resizer smears every edge into a blur, because the resizer assumes a photograph and invents in-between colours. Pixel art needs the opposite: hard edges, a palette you chose, and steps that still read as steps at four times the size.
This page offers four ways to enlarge, from an exact block copy to two edge-aware smoothers, shows the result next to the plain block copy at the same size, and tells you whether any colour was invented.
Key features
- Nearest neighbour at ×2 to ×8, which only repeats pixels
- Scale2x and Scale3x (the EPX family), with ×4 and ×8 as repeated Scale2x and ×6 as Scale3x then Scale2x
- A simplified hq2x-style smoother and a simplified xBR-style edge-directed scaler, both at ×2, ×4 and ×8
- Sprite-sheet mode with frame size, offsets and gaps, each frame scaled on its own, plus a palette report (colours in, colours out, and whether every output colour already existed) and a hard-alpha option for the smoothing modes
How each scaling method works
Scale2x looks at the four neighbours of a pixel. A corner of the enlarged 2 × 2 block takes the colour of an adjacent neighbour only when two neighbours on that side match each other and the two on the opposite sides differ. It copies, never mixes, so a two-colour sprite stays a two-colour sprite. Scale3x applies the same idea with extra conditions on the diagonal neighbours to fill the 3 × 3 block.
The smooth and edge methods are simplified reimplementations and are named that way on purpose. The smooth method uses hq2x's colour-similarity thresholds (luma within 48, and the two chroma differences within 7 and 6) but only has one rule: when both neighbours of a corner differ from the pixel and match each other, the corner is blended 2 : 1 : 1. The edge method borrows xBR's idea of comparing weighted colour distances on either side of a diagonal and rounds a corner only when the pixel's own side is calmer. Neither reproduces the original 256-pattern hq2x table or the xBR/xBRZ shape tables, so expect softer, simpler results than a reference implementation.
How it works
The picture is copied into a buffer with a two-pixel border that repeats the edge, so every pixel has all its neighbours. In sheet mode each frame is cut out first and gets its own border, which is why a frame's edge never picks up colour from the frame next to it. Larger factors run the 2× step again on its own output. The work runs in a worker that is stopped when you change a setting or press Cancel, and any result over 36 million pixels or 16,384 pixels on a side is refused before anything is allocated.
Common use cases
- Splash art drawn at 640 × 360 for a 4K build: ×6 nearest neighbour gives exactly 3,840 × 2,160, one source pixel per 6 × 6 block, so the game engine never has to resample by a fraction and the palette line reports the same colours in and out.
- A 48 × 64 portrait sprite for a poster: ×8 nearest neighbour gives 384 × 512 px of crisp 8 × 8 blocks with no colour that was not already in the sprite, which is what the print shop's colour proof will show.
- A tileset of sixteen 32 × 32 tiles in a 4 × 4 grid with a 1 px gap is 131 × 131 px. Set the frame size to 32 × 32 and the gap to 1, and a ×4 Scale2x run gives a 524 × 524 sheet where the tile edges stay crisp and the gaps stay clear.
How to use this tool
- Drop one sprite or a whole set of files, then choose the method and the scale. Methods that cannot make a factor leave it out of the list.
- For a sheet, tick Scale each frame separately and enter the frame size, offset and gap until the frame count matches.
- Compare the two panels, then download one PNG or all files as a ZIP named with the factor and method.
Example
A hand-drawn 5 × 5 sprite: a black diagonal on white
Scale2x ×2, then Edge-directed ×2Size and palette line for each run
Scale2x: 10 × 10, 2 colours in and 2 out, every output colour already in the source
Edge-directed: 10 × 10, 3 colours out, corners along the diagonal blended grey
Nearest ×4 of the same sprite: 20 × 20Common pitfalls
GIF input uses the first frame only. Split an animation into frames or a sheet before scaling.
The smoothing methods blend alpha too; keep the hard-edge option on for sprites that must stay cut out.
- Check the palette line before choosing a smoother: for a game or console with a fixed palette, only nearest neighbour and Scale2x/3x are guaranteed to stay inside it.
- Frames that touch (gap 0) still need sheet mode, because the plain mode treats the whole sheet as one picture, so a frame's edge pixels take colour from the frame beside it.
Common errors and how to fix them
- "At ×8 the result would be … pixels. The limit is 16,384 per side and 36 million in all"
- Use a smaller factor, or crop the sheet. A 2,048 × 2,048 sheet can go to ×2 but not ×3.
- "No whole frame fits inside the picture with these numbers"
- Check the frame width and height against the sheet size, and that the offset leaves room for at least one frame.
- "… is 6000 × 4000 pixels. Pixel-art sources are limited to 4096 per side and 4 million in all"
- Larger pictures are not pixel art. Crop the sprite sheet, or shrink a photo first.
- "… cannot make ×5"
- Scale2x and the smoothing methods work in steps of 2 and 3. Choose nearest neighbour for ×5 or ×7.
Best practices
- Do the scaling once at the final size from the original, not on an already enlarged copy, so each pass starts from clean pixels.
Which method for which job
Use nearest neighbour when the output must stay inside a palette or when the result will be scaled again by an engine: every output pixel is a copy of a source pixel, and ×5 and ×7 are only possible here. Use Scale2x or Scale3x when you want diagonals to look less jagged but still need a guaranteed palette, since they also only copy. The two smoothing methods add blended colours, so choose them only for artwork that is not tied to a palette, and check the colour counts in the palette line afterwards.
Sheet mode matters most for tiles and animation strips: without it, a frame's edge pixels are scaled using the colour of the frame beside it, and a one-pixel outline picks up a fringe of the neighbour's colour.
Frequently asked questions
Why are only whole-number factors offered?
Every method works in whole steps: Scale2x doubles, Scale3x triples and larger factors repeat those steps. A factor such as ×2.5 would make some source pixels two output pixels wide and others three, which is exactly the uneven pixel width that makes scaled pixel art look wrong. Pick the nearest whole factor and let the game engine or the display do the final fit.
Why does the edge-directed mode look softer than RetroArch's xBR shaders?
It is a simplified reimplementation. It compares weighted colour distances on either side of a diagonal as xBR does, but it does not use the original shape tables that give xBR its sharp, stepped curves, so it rounds fewer corners and blends more. For the reference look, run the original xBR or xBRZ shader in an emulator frontend; use this page when you need a predictable result and the palette report.