Possibly you use images with transparent areas on edges?
Its common problem for that images - sometimes in transparent pixels writed black color in RGB channels, and it blended with edge pixels on filtering.
GPU first do filter RGB channels in texture, without respect to alpha channel, and second apply alpha.
Look at any editor, which may show RGB channels without alpha in your image, and paint nearest with edges transparent pixels in same color, as non transparent.
In Godot engine exist options on import sprites - “Fix black edges”.
Sometime I take algoritm from it and implement on AngelScript for Urho3D:
void fixPngColors(const String& name) {
File file;
file.Open(name);
Image image;
image.Load(file);
file.Close();
Print("Load image " + image.width + " x " + image.height);
int repl = 0;
for (int r = 0; r < image.height; r++) {
for (int c = 0; c < image.width; c++) {
Color clr = image.GetPixel(c, r);
if (clr.a < 0.1) {
repl++;
Color nearestColor(0, 0, 0, 0);
int minX = Max(c - 4, 0), maxX = Min(c + 4, image.width),
minY = Max(r - 4, 0), maxY = Min(r + 4, image.height),
closestDist = 900;
for (int x = minX; x < maxX; x++) {
for (int y = minY; y < maxY; y++) {
int dist = (c - x) * (c - x) + (r - y) * (r - y);
if (dist < closestDist) {
Color pix = image.GetPixel(x, y);
if (pix.a > 0.2) {
nearestColor = pix;
closestDist = dist;
}
}
}
}
nearestColor.a = 0;
image.SetPixel(c, r, nearestColor);
}
}
}
if (repl > 0) {
image.SavePNG(name.Substring(0, name.length - 4) + "-1.png");
Print("Saved to " + name.Substring(0, name.length - 4) + "-1.png repl=" + repl);
} else {
Print("No replaced");
}
}
void fixAllPngs() {
Print("Scan files...");
String path = "Data/Sprites/";
auto files = fileSystem.ScanDir(path, "*.png", 1, true);
for (uint i = 0; i < files.length; i++) {
fixPngColors(path + files[i]);
}
}
It scan pixels in image, and if it alpha < 0.1 - search nearest non alpha pixel, and set color to that color.
Also it zeroed alpha of all pixel, where it less than threshold value.
You can tray play with threshold level of alpha in this code, for get desired result.