コード例 #1
0
ファイル: NeuQuant.cs プロジェクト: fujieda/BurageSnap
        public static Bitmap Quantize(Bitmap bmp, int sample)
        {
            var nq = new NeuQuant(bmp, sample);

            nq.Init();
            return(nq.CreateBitmap());
        }
コード例 #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);
        }