Texture image compression issue

I am working on a 2D game and am loading sprites of a sheet I drew up in paint.net. I need to work with exact pixel data, but have noticed that my pixel colors are blending. I believe unity is compressing the pixel data, and some blending occurs.

I have checked this by using the Texture2D class in my script. I have looped through the entire pixel data of my picture, and turned any non-black or non-white pixels green. I drew a black and white image, and sure enough green pixels appeared after loading it up (at the edges of black and white parts). So it is definitely blending. How can I disable this feature?

In the texture properties you need to set the filter mode from “bilinear” to “point”.
You can do this in the editor by selecting the texture itself and changing the property in the inspector.

Thank you. The actual problem was that the images needed to be power of 2 for some reason.

If you’re using the texture as a GUI element, changing the “Texture Type” in the editor to “GUI” gets rid of compression regardless of the image dimensions.