예제 #1
0
        public void TiffTest()
        {
            var test = new Tiff.TiffImage(@"C:\Temp\Cap01.tif");

            test.Save(@"C:\Temp\tifTif.tif");
            var test2 = new Tiff.TiffImage(@"C:\Temp\tifTif.tif");

            BMP.BmpImage.Export(Image.RgbToBgr(test2.Data), test2.Width, test2.Height, @"C:\Temp\TifBmp.bmp");

            var path = Path.GetTempFileName();

            var img = new Image()
            {
                Width         = 16,
                Height        = 16,
                DataStructure = Image.ImageDataStructure.Byte,
                Data          = Enumerable.Range(0, 256).Select(a => (byte)(a % 256)).ToArray()
            };

            var tif = new Tiff.TiffImage(img);

            tif.Save(path);

            var read = new Tiff.TiffImage(path);

            var pixel1 = tif.GetPixel(10, 10);
            var pixel2 = read.GetPixel(10, 10);

            Assert.IsTrue(pixel1[0] == pixel2[0] && pixel1[1] == pixel2[1] && pixel1[2] == pixel2[2]);
        }
예제 #2
0
        public void CmykTiffTest()
        {
            var test = new Tiff.TiffImage(@"C:\Temp\cmyk.tif")
            {
                DataStructure = Image.ImageDataStructure.Rgb
            };

            var png = new PNG.PngImage(test);

            png.Save(@"C:\Temp\cmykTif.png");
        }
예제 #3
0
        public void MultichannelTiffTest()
        {
            var test = new Tiff.TiffImage(@"C:\Users\javierol\Desktop\CMYKORB1024.tif")
            {
                DataStructure = Image.ImageDataStructure.Rgb
            };

            var png = new PNG.PngImage(test);

            png.Save(@"C:\Temp\cmykTif.png");
        }