Updating Sprite texture leaves red outline

So I’m using a very low-resolution texture and updating its pixels dynamically in order to create a blurry sort of overlay. When I use a pre-made texture with various degrees of alpha, and switch on bilinear or trilinear filtering, things work fine.

What I want to do, though, is change things in code. I start from an empty texture and use SetPixel() to add a color (in this case green) to the given location, then use Apply(). Unfortunately, this is the result I get:

27398-tint.png

What is the red there? No matter what color I pass to SetPixel(), I get this red glow around the colors instead of the desired green. The red is influenced by the Sprite’s overall color - if I set it to black, for instance, the red turns black. The problem occurs even when using Unity’s built-in colors, like Color.green.

Why is there red surrounding the green, and how do I get rid of it? Why doesn’t it occur with textures imported from a file?

Your shader might be doing something when 0 < alpha < 1.

It looks like your texture asset is set to something other than Blend Mode - Point and the engine is trying to smooth it out at a large scale. If that wasn’t your intention, ave you tried changing the import settings on the file itself?