Pixels not equal size and thin white stripes between pixels

Hey everyone :slight_smile:

I’m new to Unity and started developing a small 2D Jump 'n Run Game with some friends.

I have some problems with the camera settings:

The pixels don’t appear to have equal size. In the black outlines are all one pixel wide and are also shown this way if I zoom onto them in the “Scene” view. In the “Game” view however the pixels are not equal sized. I don’t mid this on most objects actually, but some are just a couple pixel big and the object looks overall really odd. I’ve noticed that it get better once I decreased the field of view. I’m also using the “Pixel Perfect Package”. I just can’t figure out how to fix this…


In the Scene view:

In the Game view:

I get these white lines flashing randomly when moving around the map. I’ve been told the “Pixel Perfect Packge” could fix this, but I couldn’t figure out how aswell…

Any help is very appreciated :slight_smile:

Looks like a beginners mistake to me ^^. Textures are usually stored in sizes that are a power of two (8,16,32,64,128,256, …). Unity will automatically resample your texture if it’s not a power of two. There are two ways to prevent that:

  • You can change the import settings of the texture and select “Non-Power-of-Two”. However this can have some performance issues and older devices might not support those in hardware.
  • The In general better approach is to make sure your textures are always a power of two in size. Note they don’t need to be square (on very old devices this also was a requirement but I think those times are over). So you could have textures that are 256x64 for example.

Sprites are usually imported and packed into an atlas texture. As long as the atlas size is a power of two everything should be fine.

I also recommend this video of 10 common pixel art mistakes

Thanks for the answer :slight_smile:

I’ve rescaled the canvas of my idle animation and sliced the animation sheet to 128x128. However, I still got the same issue. I’ve set my PPU to 32 for everything I use, since the tiles I made are all 32x32. Maybe it has something to do with this? Or maybe somthings wrong with my camera settings?

On the import setting I’m using the “Sprite (2D and UI)” as the texture type, so I don’t have the
“Non-Power-of-Two” option. When changing it to Default, my texture doesn’t show up in the first place.

Do you have any idea what else I could try?