From cfeeb0dbfe28b1f7ad5aff8645429e951d38ea4c Mon Sep 17 00:00:00 2001 From: mpohl100 Date: Sat, 5 May 2018 18:47:41 +0200 Subject: [PATCH] Set sampling factor to 1 by default This way all pixels will be considered in the Learning Phase of NeuQuant. See: https://scientificgems.wordpress.com/stuff/neuquant-fast-high-quality-image-quantization/ I encountered the problem when converting black text on white background. Sometimes the black color was not gathered because of the sampling phase of NeuQuant. This might be worth a try for other color problems too. --- GIFEncoder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GIFEncoder.js b/GIFEncoder.js index f238e9b..d62d8cf 100755 --- a/GIFEncoder.js +++ b/GIFEncoder.js @@ -56,7 +56,7 @@ GIFEncoder = function() { var closeStream = false; // close stream when finished var firstFrame = true; var sizeSet = false; // if false, get size from first frame - var sample = 10; // default sample interval for quantizer + var sample = 1; // default sample interval for quantizer var comment = "Generated by jsgif (https://github.com/antimatter15/jsgif/)"; // default comment for generated gif /**