Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan committed Sep 23, 2023
1 parent b2f9bf1 commit 6751e08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nQuant.Master/GilbertCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ private GilbertCurve(int width, int height, int[] pixels, Color[] palette, int[]
ditherMax = (hasAlpha || DITHER_MAX > 9) ? (byte) BitmapUtilities.Sqr(Math.Sqrt(DITHER_MAX) + edge) : DITHER_MAX;
if (palette.Length / weight > 5000 && (weight > .045 || (weight > .01 && palette.Length <= 64)))
ditherMax = (byte) BitmapUtilities.Sqr(5 + edge);
else if (palette.Length > 16 && palette.Length < 256)
ditherMax = (palette.Length / weight) < 3200 ? (byte) BitmapUtilities.Sqr(5 + edge) : (byte) BitmapUtilities.Sqr(3 + edge);
else if (palette.Length / weight < 3200 && palette.Length > 16 && palette.Length < 256)
ditherMax = (byte) BitmapUtilities.Sqr(5 + edge);
thresold = DITHER_MAX > 9 ? -112 : -64;
weights = new float[DITHER_MAX];
lookup = new int[65536];
Expand Down

0 comments on commit 6751e08

Please sign in to comment.