Beispiel #1
0
        static void Project64Console()
        {
            // Source: https://www.pokemonemulators.com/project64/
            ReportStart();
            string url = @"https://i.imgur.com/zzCG56R.png";

            using (Bitmap input = DownloadImage(url)) {
                IAsciifier asciifier = Asciifier.SectionedColor;
                asciifier.MaxDegreeOfParallelism = MaxCores;

                // Text
                ICharacterSet charset = CharacterSets.Bitmap;
                IAsciifyFont  font    = new BitmapAsciifyFont("Terminal", new Size(8, 12), charset);

                // Color
                Color          background = Color.Black;
                AsciifyPalette palette    = AsciifyPalette.WindowsConsole;

                // Asciify
                asciifier.Initialize(font, charset, palette);
                using (Bitmap prepared = asciifier.PrepareImage(input, 2, background))
                    using (Bitmap output = asciifier.AsciifyImage(prepared))
                        output.OpenInMSPaint();
            }
            ReportEnd();
        }
Beispiel #2
0
        static void PsychoPass()
        {
            // Source: http://www.nerdgasmneeds.com/2016/02/new-psycho-pass-dominator-replica-video.html
            ReportStart();
            string url = @"http://www.nerdgasmneeds.com/wp/wp-content/uploads/2016/02/psycho-pass-dominator-art-03.png";

            using (Bitmap input = DownloadImage(url)) {
                ISectionedAsciifier asciifier = Asciifier.SectionedColor;
                //asciifier.AllFactor
                asciifier.MaxDegreeOfParallelism = MaxCores;

                // Text
                //ICharacterSet charset = CharacterSets.Default;
                //IAsciifyFont font = new TrueTypeAsciifyFont("Lucida Console", 10, FontStyle.Bold, charset, true);
                ICharacterSet charset = CharacterSets.Bitmap;
                IAsciifyFont  font    = new BitmapAsciifyFont("Terminal", new Size(8, 12), charset);

                // Color
                //asciifier.ColorLow = Gray(50);
                //asciifier.ColorHigh = Gray(220);
                Color background = DiscordDark;
                //List<Color> colors = PaletteChooser.FindMainColorsByLab(input, 256, 1.5);
                //colors = PaletteChooser.FindMainColorsByHsb(input, 256, 0.1f, 0.001f, 0.001f);
                //AsciifyPalette palette = new AsciifyPalette(colors, background: background);
                List <Color> colors = PaletteChooser.FindMainColorsByLab(input, 16, 14);
                //colors = PaletteChooser.FindMainColorsByHsb(input, 256, 0.1f, 0.001f, 0.001f);
                AsciifyPalette palette = new AsciifyPalette(colors);

                // Asciify
                asciifier.Initialize(font, charset, palette);
                using (Bitmap prepared = asciifier.PrepareImage(input, 1.5, background))
                    using (Bitmap output = asciifier.AsciifyImage(prepared))
                        output.OpenInMSPaint();
            }
            ReportEnd();
        }