Pixel art games
How to Keep Pixel Art Crisp: Integer Scaling, Cameras and Filtering
Pixel art stays crisp when three things are true: textures use nearest-neighbour filtering, the final image is scaled by a whole number, and sprites and the camera land on the pixel grid. Blur, uneven pixels and shimmering almost always trace back to one of those three, and each has a specific fix in Godot, Unity and the browser.
The three problems and what causes them
Most pixel art rendering bugs fall into one of three symptoms. Identify the symptom first, because each one has a different cause. These are the first checks to run when setting up rendering on any pixel art game development project.
| Symptom | Usual cause | Fix |
|---|---|---|
| Soft, blurry edges | Bilinear or trilinear texture filtering, mipmaps, lossy compression | Nearest filtering, mipmaps off, lossless import |
| Some pixels wider than others | Non-integer scale factor or camera zoom | Integer scaling with letterboxing, whole-number zoom levels |
| Shimmer or wobble while moving | Sprites or camera at sub-pixel positions | Pixel snapping, or a low-resolution render target |
| Thin lines or gaps between tiles | Atlas bleeding, filtering, floating-point seams | Atlas padding or extrusion, nearest filtering, snapped camera |
Step one: turn off filtering everywhere
Texture filtering blends neighbouring texels to smooth images when they are scaled. For pixel art that blending is exactly what you do not want. Set nearest-neighbour (also called point) filtering for every sprite, tile, font and UI texture.
- Disable mipmaps on pixel art textures. Mipmaps are downscaled copies used at a distance, and they blur pixel art when the engine picks them.
- Use lossless formats. Many GPU compression formats work on blocks of pixels and can shift colors or smear edges. Keep pixel art uncompressed or lossless unless you have tested a format carefully.
- Set it globally. A project-wide default prevents the one forgotten sprite that looks soft next to everything else.
Step two: scale by whole numbers
If your game renders at 320×180 and the screen is 1920×1080, every game pixel becomes a 6×6 block. If the screen is 1366×768, the best fit is a non-integer scale of about 4.27, and some game pixels become 4 screen pixels wide while others become 5. That unevenness is what makes pixel art look "off" even when nothing is blurry.
The fix is to scale by the largest whole number that fits and fill the remaining space with bars, a border or extended scenery. Choosing a base resolution that divides evenly into common displays keeps the bars small. Our guide to choosing a resolution and sprite size lists bases that scale cleanly to 720p, 1080p, 1440p and 4K.
When bars are not acceptable
On small windows or unusual displays, integer scaling can leave large borders. A common compromise is to scale up by an integer to the nearest size above the screen, then scale down to fit with linear filtering. The result is very slightly soft at pixel boundaries but keeps pixel sizes visually even, which most players read as sharp. Offer it as an option rather than the default if your audience cares about strict pixels.
Step three: put everything on the grid
Movement is where pixel art usually breaks. A character at x = 10.4 is drawn between two pixels, and as the value changes the sprite seems to wobble or jitter, especially against a scrolling background.
There are two broad approaches, and each has trade-offs.
Approach A: render at low resolution, then upscale
Render the whole game into a texture at the base resolution (for example 320×180) and scale that texture up to the screen. Everything is forced onto the game's pixel grid automatically. This is the most faithful look, and it makes rotation and scaling of sprites look correctly chunky.
The downside is that camera movement can look steppy at low speeds, because the camera can only move one whole game pixel at a time. A known workaround is to render a slightly larger texture than the screen, snap the camera to whole pixels for rendering, then shift the final upscaled image by the leftover sub-pixel amount. That gives smooth scrolling while keeping the art on its grid.
Approach B: render at screen resolution with snapping
Render at full resolution, but snap sprite and camera positions to multiples of the game pixel size. This keeps UI and text razor sharp at high resolution and makes smooth camera movement easier. The catch is that rotated or scaled sprites will show finer pixels than the rest of the art, which can break the style if you use them heavily.
Engine settings
Godot 4
- Set the default canvas texture filter to Nearest under Rendering, Textures in Project Settings.
- Under Display, Window, Stretch, use the
viewportmode for approach A orcanvas_itemsfor approach B, and set the scale mode tointegerfor whole-number scaling. - Enable the 2D options to snap transforms and vertices to pixels, and test Camera2D smoothing carefully, as smoothing can reintroduce sub-pixel offsets.
The official Godot documentation on multiple resolutions explains each stretch mode in detail.
Unity
- Import sprites with Filter Mode set to Point, compression set to None and a consistent Pixels Per Unit value.
- Add the Pixel Perfect Camera component (Universal Render Pipeline) and set its reference resolution and assets pixels per unit to match your art.
- Choose its grid snapping mode: pixel snapping for approach B, or upscale render texture for approach A. Crop frame options control letterboxing.
We compare the wider 2D workflows of the two engines in Godot vs Unity for pixel art games.
Browser: canvas and WebGL
- For a 2D canvas, set
imageSmoothingEnabledto false on the context, and set the CSS propertyimage-rendering: pixelatedon the canvas element so the browser does not smooth it when scaling. - Account for
devicePixelRatio. Size the canvas backing store in real device pixels and choose the integer scale from that, or high-density screens will apply their own non-integer scaling. - In WebGL, use
NEARESTfor texture min and mag filters and avoid mipmaps on pixel art.
Crisp pixel art checklist
- Nearest filtering set as the project default, with no exceptions in the import presets.
- Mipmaps disabled on all 2D textures.
- Lossless or uncompressed pixel art textures.
- Atlases built with padding or extruded edges between sprites and tiles.
- Final output scaled by an integer, with a defined letterbox or border.
- Camera zoom restricted to whole-number levels.
- Sprite and camera positions snapped, or rendered through a low-resolution target.
- UI and fonts drawn for the same pixel grid, or deliberately rendered at high resolution as a separate layer.
- Tested in motion on every target display, including phones, the Steam Deck and browser windows being resized.
Animation and effects
Effects are a common source of broken pixels. Screen shake that moves the camera by fractions of a pixel, particles that scale smoothly, and tweened UI can all drift off the grid. Snap shake offsets to whole game pixels and draw particles as small sprites at fixed sizes where possible.
Sub-pixel animation (shifting color values to suggest movement smaller than a pixel) is a different thing and is drawn by the artist inside the sprite. It works on the grid and is covered in our guide to pixel art animation for games.
Getting it right from the first build
Rendering setup is cheap to do at the start and expensive to retrofit after hundreds of assets have been imported with the wrong settings. Our pixel art game development services set up filtering, scaling and camera rules in the first build so every asset that follows lands correctly.
A typical paxl.co project runs 3–4 months from kickoff to launch, starting with a short paid discovery sprint. If you have an existing game with blurry or shimmering art, that sprint is a good way to find the cause. See the pixel art games page for more.
FAQ
Why does my pixel art look blurry in the game?
Almost always because texture filtering is on. Set nearest-neighbour or point filtering on the texture or as the project default, turn off mipmaps and make sure the texture is not using a lossy compression format.
Why do my sprites jitter when the camera moves?
The sprites or the camera are at fractional pixel positions, so they are drawn slightly differently each frame. Snap positions to whole game pixels, or render the game to a low-resolution target and upscale it.
What is integer scaling?
Integer scaling means enlarging the game image by a whole number such as 3 or 4, so every game pixel becomes an identical square block of screen pixels. Any leftover screen space is filled with borders instead of stretching the image.