Beispiel #1
0
        public static Bitmap Quantize(Bitmap bmp, int sample)
        {
            var nq = new NeuQuant(bmp, sample);

            nq.Init();
            return(nq.CreateBitmap());
        }
Beispiel #2
0
        private Frame ProcessFrame(Frame cur, Frame?prev)
        {
            var frame = DifferentialFrame(cur, prev);
            var nq    = new NeuQuant(frame.Pixels, frame.Rectangle.Width, frame.Rectangle.Height, 10);

            nq.Init();
            using (var bmp = nq.CreateBitmap())
                frame.Gif = ConvertToGif(bmp);
            return(frame);
        }