How to Swap Color Palettes in Pixel Art
Color palette swapping is one of the most powerful techniques in pixel art. Whether you want to create alternate character skins, design enemy variants, or simply experiment with different color schemes, palette swapping lets you transform your artwork without redrawing a single pixel.
In this comprehensive guide, you'll learn exactly how to swap colors in pixel art using PixelPaletteSwap, from uploading your first image to exporting your finished creation.
What Is Palette Swapping?
Palette swapping is the process of replacing one or more colors in an image with different colors while keeping everything else—shapes, outlines, shading—exactly the same. It's a technique that dates back to the earliest days of video games, when hardware limitations forced developers to be creative with limited color palettes.
Classic games like Super Mario Bros. used palette swapping extensively. The Koopa Troopas, for example, came in green and red variants that were identical sprites with swapped colors. This allowed developers to create visual variety without using extra memory for additional graphics.
Today, palette swapping remains popular because it's incredibly efficient. Instead of drawing new art for every character variant, you create one base design and generate unlimited color variations from it.
Step 1: Prepare Your Pixel Art
Before you start swapping colors, make sure your pixel art is ready:
- Use clean, distinct colors: Palette swapping works best when your art uses a limited number of clearly defined colors. If your sprite has 100 shades of brown, swapping will be tedious.
- Avoid anti-aliasing: Smooth edges that blend into the background can create dozens of extra colors that complicate swapping. Stick to hard edges for best results.
- Keep your original safe: Always keep a backup of your original artwork. While you can reset changes in the tool, having a separate backup is always wise.
The best candidates for palette swapping are sprites with 4-16 colors. This is enough for detail and shading while keeping the color selection manageable.
Step 2: Upload Your Image
Getting started is simple. Navigate to the PixelPaletteSwap tool and upload your artwork in one of the following ways:
- Click the upload area to open a file browser and select your image
- Drag and drop your file directly onto the upload zone
- Upload multiple files to treat them as animation frames
The tool supports GIF, PNG, JPG, and WebP formats. If you upload a GIF, all frames will be loaded automatically, and you can see the animation play in real-time.
Step 3: Understand the Interface
Once your image is loaded, you'll see several key areas:
The Preview Canvas
This shows your pixel art with a checkerboard background (indicating transparency). Use the zoom slider to make small sprites easier to work with—pixel art often benefits from being viewed at 4x to 8x magnification.
The Color Palette
On the right side, you'll see every unique color in your image displayed as a grid of colored squares. The number in the header tells you how many colors were detected. Click any color to select it for swapping.
The Swap Controls
Below the palette, you'll find the color swap interface. Here you can see the original color you've selected and choose a new color to replace it with.
Animation Controls
For animated GIFs or image sequences, use the play/pause button and frame navigation to review your animation. The FPS slider lets you adjust playback speed.
Step 4: Select a Color to Replace
There are two ways to select a color for swapping:
Method 1: Click the Palette
In the color palette grid, click on any color square. It will become highlighted, and the "Original Color" preview will update to show your selection.
Method 2: Click the Image
Click directly on your pixel art in the preview canvas. The tool will pick up whatever color is under your cursor. This is especially useful when you're not sure which palette color corresponds to a specific part of your sprite.
Step 5: Choose a New Color
With your original color selected, choose what you want to replace it with:
Using the Color Picker
Click the color picker box (labeled "New Color") to open your browser's color selection dialog. You can pick any color from the spectrum, enter a specific hex code, or use the eyedropper to sample from anywhere on your screen.
Using an Existing Palette
If you want to match colors from another piece of pixel art, use the "Import Palette from Image" feature. Upload a reference image, and you can click any color from that image to use it as your swap target.
Many pixel artists use established palettes like PICO-8 or Endesga-32. You can download these palette images and import them as a reference to ensure color consistency across your work.
Step 6: Apply the Swap
Click the "Apply Color Swap" button. Instantly, every pixel of the original color will change to your new color—across all frames if you're working with an animation.
The change is immediately visible in the preview. If you're working with an animated GIF, you can play the animation to see how the new color looks in motion.
Step 7: Repeat for Other Colors
Most palette swaps involve changing multiple colors. For example, converting a green character to red might require swapping:
- Light green → Light red
- Medium green → Medium red
- Dark green → Dark red
Simply repeat steps 4-6 for each color you want to change. The tool tracks all your swaps, so you can see a history of the changes you've made.
Step 8: Export Your Result
When you're happy with your palette swap, it's time to export:
- Export Frame: Save the currently visible frame as a PNG file
- Export All PNGs: Download all frames as separate PNG files in a ZIP archive
For animated sprites destined for game engines, the PNG sequence export is often preferred since it gives you control over individual frames.
Advanced: Using Selection Tools
Sometimes you don't want to swap a color everywhere—just in a specific area. The selection tools let you define exactly where color swaps should apply:
- Rectangle Selection: Click and drag to create a rectangular selection area
- Polygon Selection: Click to add points and create a custom shape. Double-click or press Enter to complete the selection
With a selection active, color swaps only affect pixels within the selected area. You can also invert the selection to swap colors everywhere except the selected region.
Advanced: Saving Presets
If you've created a palette swap you want to use again—for example, a "red team" variant that you'll apply to multiple character sprites—you can save it as a preset:
- Make all your color swaps
- Click "Export" in the Color Swap Presets section
- Save the JSON file
Later, when editing a different sprite with matching original colors, you can "Import" that preset to instantly apply the same color mappings.
Common Issues and Solutions
"Too Many Colors Detected"
If your image shows hundreds of colors when you expected only a few, it likely contains anti-aliasing, gradients, or compression artifacts. Try working with a cleaner source image, or be prepared to swap many similar colors individually.
"Color Swap Looks Wrong"
Make sure you're swapping all shades of a color, not just one. If you swap dark green to dark red but leave light green unchanged, the result will look inconsistent.
"Can't Find a Color"
Use the eyedropper by clicking directly on the preview canvas. This picks up the exact color of that pixel, which you can then swap.
Next Steps
Now that you've mastered the basics of palette swapping, explore these related guides: