Skip to content

Commit

Permalink
Update GilbertCurve.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored Feb 26, 2025
1 parent 4808a74 commit e8b5457
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nQuant.Master/GilbertCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ private GilbertCurve(int width, int height, int[] pixels, Color[] palette, int[]
beta = (float) (weight > boundary ? Math.Max(.25, beta - palette.Length * weight) : Math.Min(1.5, beta + palette.Length * weight));
if (palette.Length < 16)
beta *= .75f;
}
}
else
beta *= .95f;
if (palette.Length > 64 || (palette.Length > 4 && weight > .02))
beta *= .4f;
DITHER_MAX = (byte)(weight < .01 ? (weight > .0025) ? 25 : 16 : 9);
Expand Down

0 comments on commit e8b5457

Please sign in to comment.