Keep every pixel sharp at larger sizes
Admin ·
A whole-number scale gives every sprite pixel a square block of its own. The example contains clear, half-opaque and opaque cells so you can follow all three kinds of pixels into the saved image.
Enlarge eight pixels into 72
Select Load example. Keep Scale factor at 3× and upscale the image. Before is 4 × 2 and After is 12 × 6. Each original pixel corresponds to nine identical samples in the download.
Look at the red top-left block and neighboring green block. They meet at a sharp straight boundary because the samples are copied directly.
ToolMellow RGBA channel sampleWHATWG HTML Standard, image smoothing and nearest-neighbor sampling
Follow each sample into its larger block
Download the PNG and compare these coordinates in an image inspector. Number rows and columns starting from one.
| Source position | Saved region | RGBA stored at every output position |
|---|---|---|
| Row 1, column 1 | Rows 1–3, columns 1–3 | 255, 0, 0, 255 |
| Row 2, column 2 | Rows 4–6, columns 4–6 | 64, 128, 192, 128 |
| Row 2, column 3 | Rows 4–6, columns 7–9 | 18, 37, 92, 0 |
ToolMellow RGBA channel sampleW3C Portable Network Graphics Third Edition
Calculate a size before upscaling
Multiply each displayed dimension by the scale factor. A 24 × 32 sprite enlarged by 8 becomes 192 × 256. You can set an integer factor from 2 to 16 while the result stays within the displayed limits.
Inspect partially transparent regions on the checkerboard before saving. The 8-bit sRGB PNG copies the decoded RGBA samples into every enlarged block.
WHATWG HTML Standard, image smoothing and nearest-neighbor samplingW3C Portable Network Graphics Third Edition
Common questions
Why does a diagonal still look like steps?
Integer replication enlarges each original cell. The diagonal keeps the same pattern of steps as the source sprite.
Can I use an EXIF-oriented JPG?
Yes. The decoder applies supported orientation to determine the displayed source dimensions. The scale uses those dimensions.