Gridwright Start for $1

Godot Pixel Perfect: Pixel Art Settings for Godot 4

Fix blurry, uneven and jittery pixel art in Godot 4: texture filter, integer scaling, pixel snapping, a camera that doesn't shake, sharp fonts and imports.

Godot Pixel-Perfect Setup at work
Godot Pixel-Perfect Setup at work: Crisp, jitter-free pixel art in Godot 4.

You drop your first sprite into a Godot 4 scene, press play, and it looks like it was smeared with a thumb. You fix that, make the window bigger, and now some pixels are fat and some are thin. You fix that too, add a camera with smoothing so it feels nice, and the hero starts to shake a pixel back and forth against the ground every time they walk.

None of this is your art. Godot's defaults are made for high resolution games, and pixel art needs six settings changed before it looks the way you drew it. This guide goes through all six in the order they bite, with the exact menu paths and the lines for project.godot. Then it shows the Godot Pixel-Perfect Setup writing them for your game's size, with a camera script that doesn't jitter.

The three ways pixel art goes wrong in Godot 4

  • Blurry sprites. The default texture filter is Linear. When the game is scaled up, every pixel is blended with its neighbours, so every edge goes soft.
  • Uneven pixels. If your 320x180 game fills a 1366x768 laptop screen, it is scaled by about 4.27. Some pixels come out 4 screen pixels wide and some 5, and an even checkerboard looks like a ripple.
  • Shimmer and jitter. A sprite at x = 10.5 sits between two pixels. As it moves it flickers between them, and with camera smoothing on, the camera and the player each snap to a pixel at different moments, so the player shakes against the world.

Each one has a fix in the settings, and the camera needs a few lines of code.

Top-Down Tileset
Top-Down Tileset: 16x16 top-down pixel art tileset with real autotiles: grass, sand, snow, water, cliffs, props. One of the 150 packs in Gridwright.

Step 1: Set the texture filter to Nearest

Open Project > Project Settings, go to Rendering > Textures > Canvas Textures and set Default Texture Filter to Nearest. Nearest keeps every pixel a hard square, however far the game is scaled.

Top-Down Characters
Top-Down Characters: 16x16 top-down pixel art RPG characters: 4 directions, idle and walk animations, emotes. One of the 150 packs in Gridwright.

This is project-wide. A single node can still override it with its own Texture > Filter property in the Inspector, which is set to Inherit by default. If one sprite stays blurry after the change, check that it isn't set to Linear there.

Step 2: Pick your game's resolution and scale it by whole numbers

Pixel art games are drawn at a small resolution and scaled up. Choose that size first. 320x180 and 640x360 are popular because they scale evenly to 720p, 1080p, 1440p and 4K: 320x180 is exactly 6x on a 1080p screen and 4x on 720p.

In Display > Window > Size, set Viewport Width and Viewport Height to your game's size. A 320x180 window is tiny on a desktop, so set Window Width Override and Window Height Override to a whole multiple, for example 1280x720 (4x).

Then in Display > Window > Stretch:

  • Mode: viewport. The whole game is drawn at its own resolution, then scaled, like a real retro screen. Text, rotated sprites and particles are pixelated too. If you want sprites crisp but text and rotation smooth, use canvas_items instead: it draws them at the screen's full resolution.
  • Aspect: keep. The picture keeps its shape, with bars where the screen has a different shape.
  • Scale Mode: integer. This one arrived in Godot 4.2. It uses the biggest whole number that fits and fills the rest with black bars. Our 320x180 game on that 1366x768 laptop is drawn at 4x (1280x720) with thin bars, and every pixel is exactly 4x4.

If you don't see a setting, turn on Advanced Settings at the top right of the Project Settings window.

Step 3: Snap 2D to whole pixels

In Rendering > 2D > Snap, turn on Snap 2D Transforms to Pixel and Snap 2D Vertices to Pixel. Every sprite is then drawn on a whole pixel, wherever its position really is, and the shimmer on slow movement goes away.

Step 4: Make the camera follow without jitter

This is the one most guides leave out. Turn on Position Smoothing on a Camera2D, and the camera ends up on fractions of a pixel. Snapping rounds the camera and the player each on their own, at different moments, so for a frame the player is one pixel ahead of the ground and the next frame one pixel behind it. It reads as a shake.

The fix is to smooth in your own code and round the distance between the camera and the player, not each position by itself. The player then keeps its screen pixel until the smoothing has moved a whole pixel. Turn off the Camera2D's own Position Smoothing and put this on it:

extends Camera2D

@export var target: Node2D
@export_range(0.0, 30.0, 0.5) var smoothing: float = 8.0

var _pos := Vector2.ZERO


func _ready() -> void:
	position_smoothing_enabled = false
	_pos = target.global_position if target else global_position
	global_position = _pos.round()


func _physics_process(delta: float) -> void:
	if target == null:
		return
	var goal := target.global_position
	if smoothing > 0.0:
		_pos = _pos.lerp(goal, 1.0 - exp(-smoothing * delta))
	else:
		_pos = goal
	# round the distance to the target, not each position on its own
	global_position = goal.round() - (goal - _pos).round()

It follows in _physics_process because a CharacterBody2D moves there. If your player moves in _process, move the follow there too. Keep the game size even (320x180, not 321x181), so the camera's centre lands on a whole pixel.

Step 5: Keep pixel fonts sharp

Fonts are smoothed for ordinary text, so a pixel font comes out blurry by default. Select the font file, and in the Import dock set Antialiasing to None, Hinting to None and Subpixel Positioning to Disabled, then press Reimport. To set it for the whole project, the same three are in GUI > Theme as Default Font Antialiasing, Hinting and Subpixel Positioning.

Use the font at its design size or a whole multiple of it: 8, 16 or 24 for an 8 px font. At 11 px it will blur whatever you set.

Step 6: Leave imports lossless

Select a sprite and check the Import dock: Compress Mode should be Lossless and Mipmaps off. Those are the defaults for 2D, but Godot switches a texture to VRAM compression when it sees it used in 3D, and that smears colours across pixels. Change them back and press Reimport.

All of it in project.godot

Close the project in Godot, then paste these lines at the end of project.godot (for a 320x180 game in a 1280x720 window). You can also type the same values in Project Settings.

[display]

window/size/viewport_width=320
window/size/viewport_height=180
window/size/window_width_override=1280
window/size/window_height_override=720
window/stretch/mode="viewport"
window/stretch/aspect="keep"
window/stretch/scale_mode="integer"

[gui]

theme/default_font_antialiasing=0
theme/default_font_hinting=0
theme/default_font_subpixel_positioning=0

[rendering]

textures/canvas_textures/default_texture_filter=0
2d/snap/snap_2d_transforms_to_pixel=true
2d/snap/snap_2d_vertices_to_pixel=true

A section that is already in the file, such as [rendering], can appear twice: Godot reads both.

Your game, looking finished

Every Gridwright asset pack, made to fit together, and all 44 tools for the fiddly work, with every new release, for $17 a month. Try it in your own game first: 3 days for $1 with every tool and up to 10 packs. Cancel any time.

Start: 3 days for $1 See everything it includes

The fast way: the Godot Pixel-Perfect Setup

The Godot Pixel-Perfect Setup does the six steps for your own game in a minute, in your browser.

  • Your resolution: pick 320x180, 384x216, 426x240, 480x270, 640x360 or 256x224, or type your own. It tells you the whole-number scale you get on 720p, 1080p, 1440p and 4K.
  • The window it opens in, from 1x to 8x, and the stretch mode, viewport or canvas_items, with what each one does to text and rotation.
  • Sharp pixel fonts for the whole project with one tick.
  • The camera: set the smoothing from 0 (locked to the player) to 30 (snappy), and whether your player moves in _physics_process.
  • Live demos of the problems next to their fixes: blurry against crisp, and jittery against snapped with the same smoothing.
  • A checklist of the six steps to tick off in your project.

It downloads one ZIP: project_settings.txt with the lines for your size, pixel_camera.gd (the camera above, with a snap_to_target() for teleports and new levels) and a README with every step. The settings and the script were tested in Godot 4.7.2.

Common problems and their fixes

Still blurry after Nearest. The node has its own Texture > Filter set to Linear, or the sprite was imported with VRAM compression. Set the node to Inherit and the import to Lossless.

Black bars around the game. That is integer scaling working: the screen isn't a whole multiple of your game's size. Pick a resolution that divides your players' screens, or set Aspect to expand, so a wider or taller screen shows more of the world instead of wide bars.

The player still shakes. The Camera2D's own Position Smoothing is still on next to the script, or the camera follows in _process while the player moves in _physics_process.

UI text is pixelated and you didn't want it. Switch the stretch mode to canvas_items.

Make your pixel art look the way you drew it

Open the Godot Pixel-Perfect Setup page to see what it does. It runs inside Gridwright, one of 44 tools in the plan, with 150 asset packs made on whole-pixel grids that look right the moment these settings are in. Start for 3 days for $1, then $17 a month, and press play on crisp pixels today.

Your game, looking finished

Every Gridwright asset pack, made to fit together, and all 44 tools for the fiddly work, with every new release, for $17 a month. Try it in your own game first: 3 days for $1 with every tool and up to 10 packs. Cancel any time.

Start: 3 days for $1 See everything it includes