Spritesheet Bleed

Common problem, specifically in Unity, whereby “lines” show due the nature of the rendering engine; (maybe because it’s a 3D framework?).

This is the kinda thing you see:

Tile bleed issue (sub pixel rendering) shown in Unity

You can usually fix it by creating a Pixel Snap Material for the Tilemap, setting filter to none and turning anti aliasing off in project settings. However this doesn’t always solve the issue and have to result to adding a pixel margin around each tile… Which is mental to do for the artist, not too much of an issue for the designer/developer but this kinda thing should be automated.

Automatic bleed zone generator

So I’ve written a script to do so, using ImageMagick.

Head over to the Github page; it’s not perfect but does the trick.

I couldn’t get it to have a 1px margin and instead it has an over compensated 16px margin, feel free submit a PR if you get it working with 1px.

Getting it working in Unity

Then all you have to do in Unity is splice by 16 with offsets of x and y to compensate.

Here are the exact settings for that:

Settings for the Unity Sprite Editor for a sprite sheet with tile bleed compensation

Click slice and you shoud now see this:

Unity Sprite Editor with a sprite sheet with tile bleed

Hit apply etc. then setup the palette by dragging in the folder and the palette should look the same as before (without bleed) for easy drawing:

Unity Palette setup from a sprite sheet with tile bleed compensation

Tada.

FIXED Tile bleed issue (sub pixel rendering) shown in Unity

Let me know @cjonasw if you have any issues.