Artifacts on pixel sprites after slicing in Sprite Editor

I am slicing a 300x270 spritesheet into 30x30 grid slices to produce sprites like the following:

2176569--144153--Screen Shot 2015-06-26 at 10.47.06 AM.png

I’m noticing that in the Sprite Editor that it’s not slicing them pixel perfect and it’s including a little bit of an artifact on the bottom of the above sprite for example (his two feet):

2176569--144154--Screen Shot 2015-06-26 at 10.50.16 AM.png

When I then include this in my scene I see the artifact like this in game (see above his head? that’s his feet from the sprite above):

2176569--144155--Untitled.png
I should mention the settings I’m using for the spritesheet before I slice them:

Texture Type: Sprite (2D and UI)
Sprite Mode: Multiple
Pixels Per Unit: 16
Generate Mip Maps: True
Filter Mode: Point
Max Size: 512 (my spritesheet is 300x270)
Format: Truecolor

Am I slicing these images correctly or is there something I’m doing wrong?

  1. You are also probably using Filter Mode: Bilinear/Trilinear. Bilinear/trilinear filtering smooths the images. Try changing this to Point.

If this doesn’t work:

  1. You should add at least 1 pixel between edges of your Image. So, move your character so that there’s at least 1 pixel between legs and lower bound of the slice.

Bear Boom
iOS: https://itunes.apple.com/us/app/id985992564?mt=8
Android: https://play.google.com/store/apps/details?id=com.Airbear.Airbear

2 Likes

I have so many spritesheets that moving them all to have 1 pixel between edges is ridiculously time consuming. Is that seriously the only way possible? Seems like a bug in Unity.

I also mentioned all the settings I’ve used for my spritesheets and Filter Mode: Point was one of them.

Thanks for your reply.

You could try adding an offset value when grid slicing your sprite sheet in the Sprite Editor to ensure that your sprites are captured correctly in your sliced cells. You can verify that by zooming in in the Sprite Editor to see if the pixels belong to the right cells.

Alternatively, you can make use of the Sprite Packer by adding a SpritePackingTag to your textures. This will add an edge padding to your packed sprites.

2 Likes

I had this issue and fixed it by slightly raising the sprite’s position on the y-axis. I think it was something to do with how I placed the sprite in the scene on the ground collider. Maybe they were overlapping and causing issues.

1 Like