Ejemplo n.º 1
0
        public void CanCompressImageUsingPalette()
        {
            var rawBytes = File.ReadAllBytes(GetImageFile("10by9pixelsrgb8bpp.png"));
            var png      = Png.Open(rawBytes);
            var builder  = PngBuilder.FromPng(png);

            var compressed = builder.Save(SaveCompressed);

            Assert.True(compressed.Length < rawBytes.Length, $"Compressed size {compressed.Length} bytes was not smaller than raw size {rawBytes.Length}.");
        }