Quantization window now handles 15bpp, Updated layout, Cluts are shorter if less centroids were found

This commit is contained in:
2025-01-14 12:04:44 +01:00
parent f0bc61dd92
commit 65e52940ec
3 changed files with 73 additions and 22 deletions

View File

@@ -82,8 +82,9 @@ public class ImageQuantizer
pixelArray[x, y, 2] = centroidColor.z; // Blue
}
Vector3[,] clut = new Vector3[maxColors, 1];
for (int i = 0; i < centroids.Count; i++)
int actualColors = centroids.Count;
Vector3[,] clut = new Vector3[actualColors, 1];
for (int i = 0; i < actualColors; i++)
{
clut[i, 0] = centroids[i];
}