Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("RLE is processing");
            RLE_compresser.compressBmpImage(bmpImagesPath + "RLE/test.bmp", bmpImagesPath + "RLE/test_compressed.bmp");

            Console.WriteLine("\nRLE/test.bmp image is comprassed to RLE Format  And Saved in RLE/test_compressed.bmp");
            Console.ReadLine();


            Console.WriteLine("LZW is processing");
            LZW_comprasser.compressBmpImage(bmpImagesPath + "LZW/test5.bmp", bmpImagesPath + "LZW/test_compressed.tiff");

            Console.WriteLine("\nLZW/test5.bmp image is comprassed to LZW Format  And Saved in LZW/test_compressed.bmp");
            Console.ReadLine();


            Console.WriteLine("JPEG is processing");
            JpegComprasser.compressBmpImage(bmpImagesPath + "JPEG/test.bmp", bmpImagesPath + "JPEG/test_compressed.jpg");

            Console.WriteLine("\nJPEG/test.bmp image is comprassed to LZW Format  And Saved in JPEG/test_compressed.jpeg");
            Console.ReadLine();



            Console.WriteLine("Done\n Start comparise Time of the same image");
            Console.ReadLine();

            DateTime startPoint = DateTime.Now;

            JpegComprasser.compressBmpImage(bmpImagesPath + "TimeComparison/COLLISN2.bmp", bmpImagesPath + "TimeComparison/jpg_compressed.jpg");
            DateTime endPoint = DateTime.Now;

            Console.WriteLine($"BMP TO JPEG Take: {(endPoint - startPoint).TotalMilliseconds} milliseconds");

            startPoint = DateTime.Now;
            LZW_comprasser.compressBmpImage(bmpImagesPath + "TimeComparison/COLLISN2.bmp", bmpImagesPath + "TimeComparison/lzw_compressed.tiff");
            endPoint = DateTime.Now;
            Console.WriteLine($"BMP TO LZW Take: {(endPoint - startPoint).TotalMilliseconds} milliseconds");

            startPoint = DateTime.Now;
            RLE_compresser.compressBmpImage(bmpImagesPath + "TimeComparison/COLLISN2.bmp", bmpImagesPath + "TimeComparison/rle_compressed.bmp");
            endPoint = DateTime.Now;
            Console.WriteLine($"BMP TO RLE Take: {(endPoint - startPoint).TotalMilliseconds} milliseconds");

            Console.WriteLine("Done\n Start time comparison of the same image");
            Console.ReadLine();
            Console.WriteLine("JPEG minus BMP");
            var bmpBytesMatrix = ImageExtension.GetBitMapColorMatrix(bmpImagesPath + "TimeComparison/COLLISN2.bmp");
            var jpegBytes      = ImageExtension.GetBitMapColorMatrix(bmpImagesPath + "TimeComparison/jpg_compressed.jpg");
            var comResBmpJpg   = CompareImages(bmpBytesMatrix, jpegBytes, qualityComparison);

            ImageExtension.SaveBitmap(ImageExtension.GetBitmap(comResBmpJpg), bmpImagesPath + "TimeComparison/comResBmpJpg.bmp");

            //Console.ReadLine(); Console.ReadLine();
            //Console.WriteLine("LZW minus BMP");
            //bmpBytesMatrix = ImageExtension.GetBitMapColorMatrix(bmpImagesPath + "TimeComparison/COLLISN.bmp");
            //var lzwBytes = ImageExtension.GetBitMapColorMatrix(bmpImagesPath + "TimeComparison/lzw_compressed.tiff");
            //var comResBmpLZW = CompareImages(bmpBytesMatrix, lzwBytes, qualityComparison);
            //ImageExtension.SaveBitmap(ImageExtension.GetBitmap(comResBmpLZW), bmpImagesPath + "TimeComparison/comResBmpLzw.bmp");

            //Console.ReadLine();
            //Console.ReadLine();
            //Console.WriteLine("RLE minus BMP");
            //bmpBytesMatrix = ImageExtension.GetBitMapColorMatrix(bmpImagesPath + "TimeComparison/COLLISN.bmp");
            //var rleBytes = ImageExtension.GetBitMapColorMatrix(bmpImagesPath + "TimeComparison/rle_compressed.bmp");
            //var comResBmpRle = CompareImages(bmpBytesMatrix, rleBytes, 200);
            //ImageExtension.SaveBitmap(ImageExtension.GetBitmap(comResBmpRle), bmpImagesPath + "TimeComparison/comResBmpRle.bmp");

            Console.ReadLine();
        }