Godot Pixel-Perfect Setup
Crisp, jitter-free pixel art in Godot 4
Your game's resolution
Stretch mode
Everything at your game's pixels, like a real retro screen: text and rotation are pixelated too.
project_settings.txt, pixel_camera.gd and a README with these steps.
Blurry or crisp
Jittery or snapped
The checklist
0 of 6 done- Project Settings > Rendering > Textures > Canvas Textures > Default Texture Filter: Nearest
Linear, the default, blends each pixel with its neighbours when the game is scaled up, so every edge goes soft. Nearest keeps each pixel a sharp square.
- Project Settings > Display > Window > Size: Viewport Width and Height = your game's size, Window Width and Height Override = the window you open in
- Display > Window > Stretch: Mode viewport (or canvas_items), Aspect keep, Scale Mode integer
At 4.5x some pixels are 4 screen pixels wide and some are 5, and the art looks uneven. Integer scaling uses the biggest whole number that fits and fills the rest with black bars.
- Project Settings > Rendering > 2D > Snap: Snap 2D Transforms to Pixel and Snap 2D Vertices to Pixel: On
A sprite at x = 10.5 is drawn between two pixels and shimmers as it moves. Snapping puts every sprite on a whole pixel.
- Put pixel_camera.gd on your Camera2D and drag the player into Target
- Turn off the Camera2D's own Position Smoothing: the script smooths for you
With smoothing on, the camera and the player each get rounded to a pixel on their own, at different moments, so the player shakes a pixel against the background. The script rounds the distance between them instead.
- Select the font file > Import dock: Antialiasing None, Hinting None, Subpixel Positioning Disabled, then Reimport
- Use it at its design size or a whole multiple (8, 16, 24 for an 8 px font); in a Theme, set Default Font and Default Font Size
Fonts are smoothed for ordinary text. A pixel font at 11 px, or with antialiasing on, comes out blurry.
- Select a sprite > Import dock: Compress Mode Lossless, Mipmaps off (the defaults for 2D), then Reimport if you changed them
VRAM compression smears colours across pixels, and mipmaps soften a sprite when it is drawn smaller.
Your files
; Gridwright Godot Pixel-Perfect Setup: a 320 x 180 game in a 1280 x 720 window (4x), stretch mode viewport. ; Paste at the end of project.godot (Godot 4.2 or later). A section already in the file can appear twice: Godot reads both. [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
Not sure which resolution? The Pixel Art Size Calculator works it out from your tile size. Art saved blurry or at the wrong size? The Pixel Art Upscaler scales it by whole numbers. Stuck on a step? Ask in our Discord.
The Godot Pixel-Perfect Setup fixes the two things that make pixel art look wrong in Godot 4: blurry sprites and a camera that jitters. It walks through the six settings that matter (texture filter, resolution and integer scaling, pixel snapping, the camera, fonts and imports), with live demos that show each problem next to its fix.
Pick your game's resolution and the window it opens in, and it writes the lines for project.godot: Nearest filtering, stretch mode viewport or canvas_items with integer scaling, and snapping to whole pixels. The camera script follows your player with smoothing but keeps the camera on whole pixels by rounding the distance between them, so the player never shakes against the background.
Everything comes as one ZIP with a README, and the settings and the script were tested in Godot 4.7.2. Try it on the page with no account.
A first session
- 1Pick your game's resolution, the window size and the stretch mode.
- 2Watch the demos and tick off each step of the checklist in your project.
- 3Download the ZIP and paste project_settings.txt at the end of project.godot.
- 4Put pixel_camera.gd on your Camera2D and drag the player into Target.
- It exports
- project.godot settings
- Pixel-perfect Camera2D script (GDScript)
- README with the checklist
- Try it, then buy it
- Try it free on this page. Downloading what you make comes with the tool, bought once.
- Can I use what I make in a commercial game?
- Yes. What you make with the tools is yours to use in your games, commercial ones too, under the Gridwright licence.