Game asset processing3 min read

Canvas Pixel Art Export: Test the Saved Pixels for Smoothing

Use a two-color fixture to distinguish pixels written by Canvas scaling from a soft on-screen preview.

Canvas Pixel Art Export: Test the Saved Pixels for Smoothing
Pixel phoenix proof sheets compare hard squares with softened edges
Concept illustration

A sharp browser preview doesn't prove that a larger downloaded PNG keeps its hard edges. Test the Canvas resampling step directly on the pixels that become the file.

Draw the same two-color source twice

Make an opaque 16 by 16 PNG split at column eight into two solid colors. Set the backing size of two canvases to 64 by 64 before configuring their contexts. Enable imageSmoothingEnabled on one, disable it on the other, and use drawImage to scale the entire image to 64 by 64. Read the center row with getImageData and inspect pixels on both sides of the split.

Confirm the result after export

With smoothing disabled and integer scaling, each source pixel should occupy a solid four-by-four block. The seam should use only the source colors. The smoothed sample can contain blended pixels; exact values depend on the browser. Export both PNGs and decode them again. If the unsmoothed file still blends the edge, inspect the original for antialiasing and check for another scaling step.

Apply the check to a real sprite

Prepare a representative frame in the sprite cutter, then verify your own export pipeline. Setting a canvas width or height resets drawing state, so configure smoothing after sizing the canvas. A CSS preview is useful for display QA but doesn't tell you which colors the file contains.

Recommended tools

Ready to try "Canvas Pixel Art Export: Test the Saved Pixels for Smoothing"?

Use our online tools to apply this tutorial to your indie game project right away.