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];
}

View File

@@ -25,6 +25,9 @@ namespace PSXSplash.RuntimeCode
[Range(1, 256)]
public int Height = 128;
// TODO: This just uses the quantization and doesn't store the result anywhere
// Maybe it should return the image and the clut back to the SceneExporter / The Editor code for only-texture export?
public void Export(GameObject gameObject)
{
Debug.Log($"Export: {this}");