public void Linearize(string name) { GammaTable table = new GammaTable(new ushort [] { 0x0000, 0x0000, 0x0000, 0x0000 }); Profile link = new Profile(IccColorSpace.Rgb, new GammaTable [] { table, table, table }); string path = CreateFile(name, 32); using (FilterRequest req = new FilterRequest(path)) { ColorFilter filter = new ColorFilter(); filter.DeviceLink = link; Assert.IsTrue(filter.Convert(req), "Filter failed to operate"); req.Preserve(req.Current); Assert.IsTrue(System.IO.File.Exists(req.Current.LocalPath), "Error: Did not create " + req.Current); Assert.IsTrue(new FileInfo(req.Current.LocalPath).Length > 0, "Error: " + req.Current + "is Zero length"); using (ImageFile img = ImageFile.Create(req.Current)) { Pixbuf pixbuf = img.Load(); Assert.IsNotNull(pixbuf); // We linearized to all black so this should pass the gray test Assert.IsTrue(PixbufUtils.IsGray(pixbuf, 1), "failed to linearize" + req.Current); } } }