SpriteGrid

Developer documentation

Built-in effects

SpriteGrid's own effects are plugins too. These are their files, exactly as SpriteGrid writes them into the effects folder. To start from one, copy it under a new file name and give it a new id.

BevelStyle

Creates a 3D beveled edge on sprite boundaries

{
    "id": "bevel",
    "name": "Bevel",
    "author": "SpriteGrid",
    "version": "1.8",
    "description": "Creates a 3D beveled edge on sprite boundaries",
    "category": "Style",
    "tiling": false,
    "compositeMode": "replace",
    "parameters": [
        { "id": "size", "name": "Size", "type": "int", "default": 2, "min": 1, "max": 64, "ui": "slider" },
        { "id": "angle", "name": "Light Angle", "type": "int", "default": 135, "min": 0, "max": 359, "ui": "slider" },
        { "id": "depth", "name": "Depth", "type": "float", "default": 0.7, "min": 0.0, "max": 1.0, "ui": "slider" },
        { "id": "highlightColor", "name": "Highlight", "type": "color", "default": "#FFFFFFC0", "ui": "color" },
        { "id": "shadowColor", "name": "Shadow", "type": "color", "default": "#000000C0", "ui": "color" },
        { "id": "soften", "name": "Soften", "type": "int", "default": 0, "min": 0, "max": 16, "ui": "slider" },
        { "id": "roundness", "name": "Roundness", "type": "float", "default": 0.0, "min": -1.0, "max": 1.0, "ui": "slider" }
    ],
    "passes": [
        {
            "shader": "bevel.frag",
            "uniforms": {
                "uSize": "$size",
                "uAngle": "$angle",
                "uDepth": "$depth",
                "uHighlightColor": "$highlightColor",
                "uShadowColor": "$shadowColor",
                "uRoundness": "$roundness"
            }
        },
        {
            "shader": "soften.frag",
            "uniforms": { "uDirection": [1.0, 0.0], "uRadius": "$soften" }
        },
        {
            "shader": "soften.frag",
            "uniforms": { "uDirection": [0.0, 1.0], "uRadius": "$soften" }
        }
    ]
}

BloomGlow

Adds a soft glow to bright areas

{
    "id": "bloom",
    "name": "Bloom",
    "author": "SpriteGrid",
    "version": "1.1",
    "description": "Adds a soft glow to bright areas",
    "category": "Glow",
    "tiling": false,
    "parameters": [
        { "id": "threshold", "name": "Threshold", "type": "float", "default": 0.5, "min": 0.0, "max": 1.0, "ui": "slider" },
        { "id": "radius", "name": "Radius", "type": "int", "default": 4, "min": 1, "max": 32, "ui": "slider" },
        { "id": "intensity", "name": "Intensity", "type": "float", "default": 0.5, "min": 0.0, "max": 2.0, "ui": "slider" }
    ],
    "passes": [
        {
            "shader": "threshold.frag",
            "uniforms": { "uThreshold": "$threshold" }
        },
        {
            "shader": "blur.frag",
            "uniforms": { "uDirection": [1.0, 0.0], "uRadius": "$radius" }
        },
        {
            "shader": "blur.frag",
            "uniforms": { "uDirection": [0.0, 1.0], "uRadius": "$radius" }
        },
        {
            "shader": "combine.frag",
            "uniforms": { "uIntensity": "$intensity" }
        }
    ]
}

Color SimplifyColor

Bilateral filter that merges similar nearby colors while keeping edges sharp

{
    "id": "color-simplify",
    "name": "Color Simplify",
    "author": "SpriteGrid",
    "version": "1.0",
    "description": "Bilateral filter that merges similar nearby colors while keeping edges sharp",
    "category": "Color",
    "tiling": false,
    "compositeMode": "replace",
    "parameters": [
        { "id": "radius", "name": "Radius", "type": "int", "default": 2, "min": 1, "max": 8, "ui": "slider" },
        { "id": "tolerance", "name": "Color Tolerance", "type": "float", "default": 0.15, "min": 0.01, "max": 1.0, "ui": "slider" },
        { "id": "strength", "name": "Strength", "type": "float", "default": 1.0, "min": 0.0, "max": 1.0, "ui": "slider" }
    ],
    "passes": [
        {
            "shader": "color-simplify.frag",
            "uniforms": {
                "uRadius": "$radius",
                "uTolerance": "$tolerance",
                "uStrength": "$strength"
            }
        }
    ]
}

Dilate OutlineStroke

Outlines by dilating edge colors outward, tinted with a blend mode

{
    "id": "dilate-outline",
    "name": "Dilate Outline",
    "author": "SpriteGrid",
    "version": "1.0",
    "description": "Outlines by dilating edge colors outward, tinted with a blend mode",
    "category": "Stroke",
    "tiling": false,
    "compositeMode": "behind",
    "parameters": [
        {
            "id": "color",
            "name": "Tint Color",
            "type": "color",
            "default": "#000000FF",
            "ui": "color"
        },
        {
            "id": "blendMode",
            "name": "Blend",
            "type": "enum",
            "default": 0,
            "options": ["Multiply", "Add", "Overlay"],
            "ui": "dropdown"
        },
        {
            "id": "thickness",
            "name": "Thickness",
            "type": "int",
            "default": 1,
            "min": 1,
            "max": 8,
            "ui": "slider"
        },
        { "id": "includeDoubles", "name": "Include Doubles", "type": "bool", "default": false, "ui": "checkbox" }
    ],
    "passes": [
        {
            "shader": "dilate-outline.frag",
            "uniforms": {
                "uTintColor": "$color",
                "uBlendMode": "$blendMode",
                "uThickness": "$thickness",
                "uIncludeDoubles": "$includeDoubles"
            }
        }
    ]
}

Drop ShadowShadow

Adds a colored shadow behind the layer

{
    "id": "drop-shadow",
    "name": "Drop Shadow",
    "author": "SpriteGrid",
    "version": "1.1",
    "description": "Adds a colored shadow behind the layer",
    "category": "Shadow",
    "tiling": false,
    "compositeMode": "behind",
    "parameters": [
        { "id": "offsetX", "name": "Offset X", "type": "int", "default": 2, "min": -32, "max": 32, "ui": "slider" },
        { "id": "offsetY", "name": "Offset Y", "type": "int", "default": 2, "min": -32, "max": 32, "ui": "slider" },
        { "id": "blur", "name": "Blur", "type": "int", "default": 1, "min": 0, "max": 16, "ui": "slider" },
        { "id": "color", "name": "Color", "type": "color", "default": "#000000C0", "ui": "color" }
    ],
    "passes": [
        {
            "shader": "offset.frag",
            "uniforms": { "uOffset": "$offsetX", "uOffsetY": "$offsetY", "uShadowColor": "$color" }
        },
        {
            "shader": "blur.frag",
            "uniforms": { "uDirection": [1.0, 0.0], "uRadius": "$blur" }
        },
        {
            "shader": "blur.frag",
            "uniforms": { "uDirection": [0.0, 1.0], "uRadius": "$blur" }
        }
    ]
}

Edge Anti-AliasStroke

Pixel-art style selective anti-aliasing on edges — bleeds color at corners and diagonals like hand-placed AA

{
    "id": "edge-aa",
    "name": "Edge Anti-Alias",
    "author": "SpriteGrid",
    "version": "1.9",
    "description": "Pixel-art style selective anti-aliasing on edges — bleeds color at corners and diagonals like hand-placed AA",
    "category": "Stroke",
    "tiling": false,
    "compositeMode": "behind",
    "parameters": [
        {
            "id": "opacity",
            "name": "Opacity",
            "type": "float",
            "default": 0.5,
            "min": 0.05,
            "max": 1.0,
            "ui": "slider"
        }
    ],
    "passes": [
        {
            "shader": "edge-aa.frag",
            "uniforms": {
                "uOpacity": "$opacity"
            }
        }
    ]
}

EmbossStyle

Photoshop-style emboss with highlight and shadow on both sides of edges

{
    "id": "emboss",
    "name": "Emboss",
    "author": "SpriteGrid",
    "version": "1.8",
    "description": "Photoshop-style emboss with highlight and shadow on both sides of edges",
    "category": "Style",
    "tiling": false,
    "compositeMode": "replace",
    "parameters": [
        { "id": "angle", "name": "Light Angle", "type": "int", "default": 135, "min": 0, "max": 359, "ui": "slider" },
        { "id": "size", "name": "Size", "type": "int", "default": 2, "min": 1, "max": 64, "ui": "slider" },
        { "id": "depth", "name": "Depth", "type": "float", "default": 0.7, "min": 0.0, "max": 1.0, "ui": "slider" },
        { "id": "highlightColor", "name": "Highlight", "type": "color", "default": "#FFFFFFC0", "ui": "color" },
        { "id": "shadowColor", "name": "Shadow", "type": "color", "default": "#000000C0", "ui": "color" },
        { "id": "soften", "name": "Soften", "type": "int", "default": 0, "min": 0, "max": 16, "ui": "slider" },
        { "id": "roundness", "name": "Roundness", "type": "float", "default": 0.0, "min": -1.0, "max": 1.0, "ui": "slider" }
    ],
    "passes": [
        {
            "shader": "emboss.frag",
            "uniforms": {
                "uAngle": "$angle",
                "uSize": "$size",
                "uDepth": "$depth",
                "uHighlightColor": "$highlightColor",
                "uShadowColor": "$shadowColor",
                "uRoundness": "$roundness"
            }
        },
        {
            "shader": "soften.frag",
            "uniforms": { "uDirection": [1.0, 0.0], "uRadius": "$soften" }
        },
        {
            "shader": "soften.frag",
            "uniforms": { "uDirection": [0.0, 1.0], "uRadius": "$soften" }
        }
    ]
}

Gaussian BlurBlur

Smooths pixels using a two-pass Gaussian blur

{
    "id": "gaussian-blur",
    "name": "Gaussian Blur",
    "author": "SpriteGrid",
    "version": "1.3",
    "description": "Smooths pixels using a two-pass Gaussian blur",
    "category": "Blur",
    "tiling": false,
    "parameters": [
        {
            "id": "radius",
            "name": "Radius",
            "type": "int",
            "default": 2,
            "min": 1,
            "max": 32,
            "ui": "slider"
        }
    ],
    "passes": [
        {
            "shader": "blur.frag",
            "uniforms": {
                "uDirection": [1.0, 0.0],
                "uRadius": "$radius"
            }
        },
        {
            "shader": "blur.frag",
            "uniforms": {
                "uDirection": [0.0, 1.0],
                "uRadius": "$radius"
            }
        }
    ]
}

GlowGlow

Adds a colored glow inside or outside sprite boundaries

{
    "id": "glow",
    "name": "Glow",
    "author": "SpriteGrid",
    "version": "1.1",
    "description": "Adds a colored glow inside or outside sprite boundaries",
    "category": "Glow",
    "tiling": false,
    "compositeMode": "replace",
    "parameters": [
        { "id": "inner", "name": "Inner Glow", "type": "bool", "default": false, "ui": "checkbox" },
        { "id": "color", "name": "Color", "type": "color", "default": "#FFD700FF", "ui": "color" },
        { "id": "size", "name": "Size", "type": "int", "default": 4, "min": 1, "max": 16, "ui": "slider" },
        { "id": "intensity", "name": "Intensity", "type": "float", "default": 0.8, "min": 0.0, "max": 2.0, "ui": "slider" }
    ],
    "passes": [
        {
            "shader": "glow.frag",
            "uniforms": {
                "uInner": "$inner",
                "uGlowColor": "$color",
                "uSize": "$size",
                "uIntensity": "$intensity"
            }
        }
    ]
}

Gradient MapColor

Maps pixel luminance to a user-defined gradient

{
    "id": "gradient-map",
    "name": "Gradient Map",
    "author": "SpriteGrid",
    "version": "1.0",
    "description": "Maps pixel luminance to a user-defined gradient",
    "category": "Color",
    "parameters": [
        {
            "id": "gradient",
            "name": "Gradient",
            "type": "gradient"
        }
    ],
    "passes": [
        {
            "shader": "gradient-map.frag",
            "uniforms": {
                "uGradientLut": "$gradient"
            }
        }
    ]
}

HSVColor

Adjusts hue rotation, saturation, and value (brightness) of the layer

{
    "id": "hsv",
    "name": "HSV",
    "author": "SpriteGrid",
    "version": "1.0",
    "description": "Adjusts hue rotation, saturation, and value (brightness) of the layer",
    "category": "Color",
    "parameters": [
        { "id": "hue",        "name": "Hue Shift",   "type": "int",   "default": 0,   "min": -180, "max": 180, "ui": "slider" },
        { "id": "saturation", "name": "Saturation",  "type": "float", "default": 1.0, "min": 0.0,  "max": 2.0, "ui": "slider" },
        { "id": "value",      "name": "Value",       "type": "float", "default": 1.0, "min": 0.0,  "max": 2.0, "ui": "slider" }
    ],
    "passes": [
        {
            "shader": "hsv.frag",
            "uniforms": {
                "uHue":        "$hue",
                "uSaturation": "$saturation",
                "uValue":      "$value"
            }
        }
    ]
}

Invert ColorsColor

Inverts all color channels

{
    "id": "invert",
    "name": "Invert Colors",
    "author": "SpriteGrid",
    "version": "1.0",
    "description": "Inverts all color channels",
    "category": "Color",
    "parameters": [
        {
            "id": "strength",
            "name": "Strength",
            "type": "float",
            "default": 1.0,
            "min": 0.0,
            "max": 1.0,
            "ui": "slider"
        }
    ],
    "passes": [
        {
            "shader": "invert.frag",
            "uniforms": {
                "uStrength": "$strength"
            }
        }
    ]
}

LevelsColor

Remaps input tonal range to output range with gamma control

{
    "id": "levels",
    "name": "Levels",
    "author": "SpriteGrid",
    "version": "1.1",
    "description": "Remaps input tonal range to output range with gamma control",
    "category": "Color",
    "parameters": [
        { "id": "inBlack", "name": "Input Black", "type": "float", "default": 0.0, "min": 0.0, "max": 1.0, "ui": "slider" },
        { "id": "inWhite", "name": "Input White", "type": "float", "default": 1.0, "min": 0.0, "max": 1.0, "ui": "slider" },
        { "id": "gamma", "name": "Gamma", "type": "float", "default": 1.0, "min": 0.1, "max": 4.0, "ui": "slider" },
        { "id": "outBlack", "name": "Output Black", "type": "float", "default": 0.0, "min": 0.0, "max": 1.0, "ui": "slider" },
        { "id": "outWhite", "name": "Output White", "type": "float", "default": 1.0, "min": 0.0, "max": 1.0, "ui": "slider" },
        { "id": "channel", "name": "Channel", "type": "enum", "default": 0, "options": ["RGB", "Red", "Green", "Blue", "Alpha"], "ui": "dropdown" }
    ],
    "passes": [
        {
            "shader": "levels.frag",
            "uniforms": {
                "uInBlack": "$inBlack",
                "uInWhite": "$inWhite",
                "uGamma": "$gamma",
                "uOutBlack": "$outBlack",
                "uOutWhite": "$outWhite",
                "uChannel": "$channel"
            }
        }
    ]
}

OutlineStroke

Draws an outline around or inside opaque pixels

{
    "id": "outline",
    "name": "Outline",
    "author": "SpriteGrid",
    "version": "1.3",
    "description": "Draws an outline around or inside opaque pixels",
    "category": "Stroke",
    "tiling": false,
    "parameters": [
        {
            "id": "color",
            "name": "Color",
            "type": "color",
            "default": "#000000FF",
            "ui": "color"
        },
        {
            "id": "thickness",
            "name": "Thickness",
            "type": "int",
            "default": 1,
            "min": 1,
            "max": 8,
            "ui": "slider"
        },
        { "id": "interior", "name": "Interior", "type": "bool", "default": false, "ui": "checkbox" },
        { "id": "includeDoubles", "name": "Include Doubles", "type": "bool", "default": false, "ui": "checkbox" },
        { "id": "alphaThreshold", "name": "Alpha Threshold", "type": "bool", "default": false, "ui": "checkbox" },
        {
            "id": "thresholdValue",
            "name": "Threshold",
            "type": "float",
            "default": 0.5,
            "min": 0.0,
            "max": 1.0,
            "ui": "slider"
        }
    ],
    "passes": [
        {
            "shader": "outline.frag",
            "uniforms": {
                "uOutlineColor": "$color",
                "uThickness": "$thickness",
                "uInterior": "$interior",
                "uIncludeDoubles": "$includeDoubles",
                "uAlphaThreshold": "$alphaThreshold",
                "uThresholdValue": "$thresholdValue"
            }
        }
    ]
}

Palette SnapColor

Snaps all colors to their nearest match in a palette

{
    "id": "palette-snap",
    "name": "Palette Snap",
    "author": "SpriteGrid",
    "version": "1.7",
    "description": "Snaps all colors to their nearest match in a palette",
    "category": "Color",
    "parameters": [
        { "id": "mode", "name": "Mode", "type": "enum", "default": 0, "options": ["OkLab", "RGB"], "ui": "dropdown" },
        { "id": "lightBias", "name": "Lightness Bias", "type": "float", "default": 1.0, "min": 0.0, "max": 5.0, "ui": "slider" },
        { "id": "chromaBias", "name": "Chroma Bias", "type": "float", "default": 1.0, "min": 0.0, "max": 5.0, "ui": "slider" },
        { "id": "grayscaleFirst", "name": "Grayscale First", "type": "bool", "default": false, "ui": "checkbox" },
        { "id": "palette", "name": "Palette", "type": "palette" }
    ],
    "passes": [
        {
            "shader": "palette-snap.frag",
            "uniforms": {
                "uMode": "$mode",
                "uLightBias": "$lightBias",
                "uChromaBias": "$chromaBias",
                "uGrayscaleFirst": "$grayscaleFirst",
                "uPaletteLut": "$palette"
            }
        }
    ]
}

PosterizeColor

Reduces color depth by quantizing channels in RGB, HSL, or OkLab

{
    "id": "posterize",
    "name": "Posterize",
    "author": "SpriteGrid",
    "version": "1.4",
    "description": "Reduces color depth by quantizing channels in RGB, HSL, or OkLab",
    "category": "Color",
    "parameters": [
        { "id": "levels", "name": "Levels", "type": "int", "default": 4, "min": 2, "max": 64, "ui": "slider" },
        { "id": "mode", "name": "Color Space", "type": "enum", "default": "OkLab", "options": ["RGB", "HSL", "OkLab"], "ui": "dropdown" },
        { "id": "hueLevels", "name": "Hue / Chroma Levels", "type": "int", "default": 0, "min": 0, "max": 64, "ui": "slider" },
        { "id": "dither", "name": "Dither", "type": "float", "default": 0.0, "min": 0.0, "max": 1.0, "ui": "slider" },
        { "id": "strength", "name": "Strength", "type": "float", "default": 1.0, "min": 0.0, "max": 1.0, "ui": "slider" }
    ],
    "passes": [
        {
            "shader": "posterize.frag",
            "uniforms": {
                "uLevels": "$levels",
                "uMode": "$mode",
                "uHueLevels": "$hueLevels",
                "uDither": "$dither",
                "uStrength": "$strength"
            }
        }
    ]
}

Rim LightStyle

Places a bright highlight rim on the light-facing edge of the sprite, leaving the opposite side untouched

{
    "id": "rim-light",
    "name": "Rim Light",
    "author": "SpriteGrid",
    "version": "1.0",
    "description": "Places a bright highlight rim on the light-facing edge of the sprite, leaving the opposite side untouched",
    "category": "Style",
    "tiling": false,
    "compositeMode": "replace",
    "parameters": [
        { "id": "angle", "name": "Light Angle", "type": "int", "default": 135, "min": 0, "max": 359, "ui": "slider" },
        { "id": "color", "name": "Rim Color", "type": "color", "default": "#FFFFFFD0", "ui": "color" },
        { "id": "intensity", "name": "Intensity", "type": "float", "default": 1.0, "min": 0.0, "max": 2.0, "ui": "slider" }
    ],
    "passes": [
        {
            "shader": "rim-light.frag",
            "uniforms": {
                "uAngle": "$angle",
                "uRimColor": "$color",
                "uIntensity": "$intensity"
            }
        }
    ]
}

Sobel EdgeStyle

Pixel-perfect color edge detection within opaque regions

{
    "id": "sobel-edge",
    "name": "Sobel Edge",
    "author": "SpriteGrid",
    "version": "1.6",
    "description": "Pixel-perfect color edge detection within opaque regions",
    "category": "Style",
    "tiling": false,
    "compositeMode": "replace",
    "parameters": [
        { "id": "color", "name": "Edge Color", "type": "color", "default": "#000000FF", "ui": "color" },
        { "id": "threshold", "name": "Threshold", "type": "float", "default": 0.1, "min": 0.0, "max": 1.0, "ui": "slider" },
        { "id": "blur", "name": "Blur", "type": "int", "default": 0, "min": 0, "max": 16, "ui": "slider" },
        { "id": "silhouette", "name": "Include Silhouette", "type": "bool", "default": false, "ui": "checkbox" },
        { "id": "includeDoubles", "name": "Include Doubles", "type": "bool", "default": false, "ui": "checkbox" },
        { "id": "mode", "name": "Blend Mode", "type": "enum", "default": "Replace", "options": ["Replace", "Multiply", "Overlay"], "ui": "dropdown" },
        { "id": "opacity", "name": "Opacity", "type": "float", "default": 1.0, "min": 0.0, "max": 1.0, "ui": "slider" }
    ],
    "passes": [
        {
            "shader": "sobel-edge.frag",
            "uniforms": {
                "uEdgeColor": "$color",
                "uThreshold": "$threshold",
                "uSilhouette": "$silhouette",
                "uIncludeDoubles": "$includeDoubles"
            }
        },
        {
            "shader": "sobel-blur.frag",
            "uniforms": {
                "uDirection": [1.0, 0.0],
                "uRadius": "$blur"
            }
        },
        {
            "shader": "sobel-blur.frag",
            "uniforms": {
                "uDirection": [0.0, 1.0],
                "uRadius": "$blur"
            }
        },
        {
            "shader": "sobel-composite.frag",
            "uniforms": {
                "uBlendMode": "$mode",
                "uOpacity": "$opacity"
            }
        }
    ]
}

StepColor

Applies GLSL step function (threshold) to RGB channels, optionally including alpha

{
    "id": "step",
    "name": "Step",
    "author": "SpriteGrid",
    "version": "1.1",
    "description": "Applies GLSL step function (threshold) to RGB channels, optionally including alpha",
    "category": "Color",
    "parameters": [
        {
            "id": "edge",
            "name": "Threshold",
            "type": "float",
            "default": 0.5,
            "min": 0.0,
            "max": 1.0,
            "ui": "slider"
        },
        { "id": "includeAlpha", "name": "Include Alpha", "type": "bool", "default": false, "ui": "checkbox" }
    ],
    "passes": [
        {
            "shader": "step.frag",
            "uniforms": {
                "uEdge": "$edge",
                "uIncludeAlpha": "$includeAlpha"
            }
        }
    ]
}