PaletteSwap Logo

How to Use a Sprite Outline Online Editor for Two-Color Effects

A good outline can make a character pop, but a standard, single-color outline often looks flat. What if you could create expressive, multi-color outlines without touching code? This guide explains how our sprite outline online editor lets you design advanced two-color effects, from fiery auras to comic-book borders, with simple controls.

Example of a sprite with a two-color outline

From a simple contour to a vibrant, two-color effect in our online editor.

The Problem: The Flat, Lifeless Outline

The standard way to create an outline is simple: find the edge of a sprite and draw a line. It works, but it's flat. It lacks depth and character. I wanted to create effects like a fiery aura, a cool magical glow, or a chunky, comic-book-style border. A single color just wasn't going to cut it. I needed a way to have an 'outer' color and an 'inner' color that could blend and interact.

The 'Aha!' Moment: Thinking in Layers

My breakthrough came when I stopped thinking about the outline as a single line and started thinking about it as a region—a space between the sprite's edge and the outer contour. What if I could control both the outer edge and the space inside it? This led to the core idea of the two-color shader available in our visual shader editor:

Suddenly, the possibilities exploded. By making the outer color a bright yellow and the inner color a transparent orange, I could create a beautiful glow. By using two opaque, contrasting colors, I could create a bold, graphic look. This was the expressive power I was looking for.

How It Works: The Neighbor Check

Technically, the shader's logic is a clever game of 'neighbor check'. For every transparent pixel on the screen, the shader peeks at the pixels around it. If it finds a non-transparent pixel (part of the sprite), it knows it's on an edge. Then, based on how far it is from that edge, it decides whether to draw the outline_color, the fill_color, or nothing at all. The outline_thickness parameter in our online tool controls how far out the shader should look, defining the size of this 'outline region'.

Adding More Spice: Spacing and Blending

Once the core two-color system was working, I couldn't resist adding a few more 'spices' to the mix, all available as simple sliders:

My Shader Code Philosophy

I built this shader in GLSL for Godot with web performance in mind. The core function, find_edge_info, is carefully written to be fast, avoiding complex loops that can slow things down in a browser. Here are the key ingredients you can play with in our no-code shader editor:


shader_type canvas_item;

// The two main colors for our effect
uniform vec4 outline_color : hint_color;
uniform vec4 fill_color : hint_color;

// Controls for the shape and style
uniform float outline_thickness : hint_range(1.0, 10.0) = 4.0;
uniform float outline_spacing : hint_range(1.0, 10.0) = 2.0; // Set > 1 for dashed lines

// Toggles and blending
uniform bool use_fill_color  = true;
uniform float gradient_blend : hint_range(0.0, 1.0) = 0.0;
            

With these simple building blocks, you can create an incredible range of styles without ever touching a line of code.

Ready to design your own outlines?

Upload your sprite to our free sprite outline online editor and start experimenting with two-color outlines right now.

Try the Sprite Outline Editor