Godot Import Settings Guide
Optimal import settings for different game asset types in Godot 4.x.
Import Settings Overview
When you add an image to a Godot project, it creates a .import file that controls how the image is processed.
Presets Reference
Pixel Art Sprites
For retro/pixel art games with crisp, unfiltered pixels.
| Setting | Value | Reason |
|---|---|---|
| Filter Mode | Nearest | Preserves hard pixel edges |
| Compress Mode | Lossless | No quality loss |
| Mipmaps | Off | Prevents blur at different scales |
| Fix Alpha Border | On | Prevents edge artifacts |
Import file settings:
compress/mode=0
mipmaps/generate=false
process/fix_alpha_border=trueProject Settings (also set globally):
rendering/textures/canvas_textures/default_texture_filter = NearestHD 2D Sprites
For high-resolution 2D games with smooth scaling.
| Setting | Value | Reason |
|---|---|---|
| Filter Mode | Linear | Smooth scaling |
| Compress Mode | VRAM Compressed | GPU-friendly |
| Mipmaps | On | Better quality at small sizes |
| Fix Alpha Border | On | Prevents edge artifacts |
Import file settings:
compress/mode=2
compress/high_quality=true
mipmaps/generate=true
process/fix_alpha_border=trueUI Elements
For interface elements like buttons, panels, icons.
| Setting | Value | Reason |
|---|---|---|
| Filter Mode | Linear (or Nearest for pixel UI) | Depends on style |
| Compress Mode | Lossless | Crisp text/edges |
| Mipmaps | Off | UI is at fixed scale |
| Fix Alpha Border | On | Clean edges |
Backgrounds
For large background images.
| Setting | Value | Reason |
|---|---|---|
| Filter Mode | Linear | Smooth appearance |
| Compress Mode | Lossy | Smaller file size OK |
| Mipmaps | On | Better for parallax |
| Lossy Quality | 0.8 | Balance size/quality |
Compression Modes
| Mode | Value | Size | Quality | Best For |
|---|---|---|---|---|
| Lossless | 0 | Large | Perfect | Sprites, UI |
| Lossy | 1 | Medium | Good | Photos, backgrounds |
| VRAM | 2 | Small | Good | Large textures, 3D |
Filter Modes
Nearest (Pixel Art)
Preserves hard pixel edges. Essential for:
- Pixel art sprites
- Retro-style games
- Any asset where you want visible pixels
Linear (Smooth)
Interpolates between pixels. Use for:
- HD sprites
- Painted/illustrated assets
- Photographs
- Backgrounds
Sprite Sheet Configuration
For sprite sheets, configure in the Import dock:
- Import as: Texture2D (default)
- Detect 3D: Off
- Process → Fix Alpha Border: On
Then in your scene:
- Create
AnimatedSprite2Dnode - Create new
SpriteFramesresource - Add frames by region or auto-slice
Using Sheet Metadata
If using pack-spritesheet.ts with --metadata:
# Load metadata
var meta = JSON.parse_string(FileAccess.open("res://sprites/sheet.json", FileAccess.READ).get_as_text())
# Create frames from metadata
var frames = SpriteFrames.new()
frames.add_animation("walk")
for frame in meta.frames:
var texture = load("res://sprites/sheet.png")
var atlas = AtlasTexture.new()
atlas.atlas = texture
atlas.region = Rect2(frame.x, frame.y, frame.width, frame.height)
frames.add_frame("walk", atlas)AnimatedSprite2D Setup
From Sprite Sheet
- Add
AnimatedSprite2Dnode - Create new
SpriteFramesin Sprite Frames property - Click SpriteFrames to open animation editor
- Add animation (e.g., "walk")
- Click folder icon → "Add Frames from Sprite Sheet"
- Select your sprite sheet image
- Configure grid (columns × rows)
- Select frames for animation
- Set FPS in animation panel
Recommended FPS
| Animation Type | FPS |
|---|---|
| Idle | 4-6 |
| Walk | 8-12 |
| Run | 10-14 |
| Attack | 12-16 |
| Effects | 15-24 |
AtlasTexture for Individual Frames
For extracting single sprites from a sheet:
var atlas = AtlasTexture.new()
atlas.atlas = preload("res://sprites/sheet.png")
atlas.region = Rect2(0, 0, 64, 64) # x, y, width, height
$Sprite2D.texture = atlasNine-Patch for UI
For scalable UI elements (panels, buttons):
- Import as Texture2D with Lossless
- Create
NinePatchRectnode - Assign texture
- Set patch margins (left, top, right, bottom)
- Set draw center as needed
var nine_patch = NinePatchRect.new()
nine_patch.texture = preload("res://ui/panel.png")
nine_patch.patch_margin_left = 16
nine_patch.patch_margin_top = 16
nine_patch.patch_margin_right = 16
nine_patch.patch_margin_bottom = 16Tileset Setup
For tile-based games:
- Import tile sheet with Nearest filter (for pixel art)
- Create
TileSetresource - Add texture as TileSetAtlasSource
- Configure tile size (e.g., 16×16, 32×32)
- Set up collision, navigation as needed
TileMap configuration:
var tilemap = TileMap.new()
tilemap.tile_set = preload("res://tilesets/world.tres")
tilemap.cell_quadrant_size = 16 # Match tile sizeProject-Wide Settings
For Pixel Art Games
In Project Settings → Rendering → Textures:
canvas_textures/default_texture_filter = NearestIn Project Settings → Display → Window:
stretch/mode = viewport
stretch/aspect = keepFor HD Games
In Project Settings → Rendering → Textures:
canvas_textures/default_texture_filter = LinearUsing generate-import-files.ts
# Pixel art preset
deno run scripts/generate-import-files.ts \
--input ./sprites/player.png --preset pixel-art
# HD sprites
deno run scripts/generate-import-files.ts \
--input ./hd-sprites/ --preset hd-sprite
# UI elements
deno run scripts/generate-import-files.ts \
--input ./ui/ --preset uiTroubleshooting
Sprites Look Blurry
- Check Filter Mode is set to Nearest
- Verify project default texture filter
- Ensure no scaling applied to Sprite2D node
Edge Artifacts / Bleeding
- Enable "Fix Alpha Border" in import
- Add 1-2px transparent padding in sprite sheet
- Use
--paddingoption in pack-spritesheet.ts
Colors Look Wrong
- Check color space settings
- Ensure PNG is saved with correct color profile
- Try Lossless compression mode
File Size Too Large
- Use VRAM compression for large textures
- Lower Lossy quality for backgrounds
- Consider splitting very large sheets